From 1b9e6e88fa0af0324be1aa7f14c6735552d1f4c7 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Sat, 10 Mar 2018 12:22:01 +0100 Subject: [PATCH] Add global locale change event, application now automatically change language when the event is triggered --- src/core/BaseModel.coffee | 4 +- src/core/api.coffee | 13 +- src/core/gui.coffee | 14 +- src/core/languages/en_GB.json | 21 ++ src/core/languages/gen.sh | 2 +- src/core/languages/vi_VN.json | 280 +++++++++--------- src/core/settings.coffee | 4 +- .../{afx-app-window.js => afx-app-window.tag} | 6 +- .../{afx-apps-dock.js => afx-apps-dock.tag} | 0 .../tags/{afx-button.js => afx-button.tag} | 0 ...calendar-view.js => afx-calendar-view.tag} | 2 +- ...x-color-picker.js => afx-color-picker.tag} | 0 src/core/tags/afx-dummy.js | 3 - src/core/tags/afx-dummy.tag | 10 + .../{afx-file-view.js => afx-file-view.tag} | 0 .../{afx-float-list.js => afx-float-list.tag} | 0 .../{afx-grid-view.js => afx-grid-view.tag} | 0 src/core/tags/{afx-hbox.js => afx-hbox.tag} | 0 src/core/tags/{afx-label.js => afx-label.tag} | 13 +- .../{afx-list-view.js => afx-list-view.tag} | 0 src/core/tags/{afx-menu.js => afx-menu.tag} | 0 .../tags/{afx-overlay.js => afx-overlay.tag} | 0 .../tags/{afx-resizer.js => afx-resizer.tag} | 0 .../tags/{afx-switch.js => afx-switch.tag} | 0 .../{afx-sys-panel.js => afx-sys-panel.tag} | 4 + ...tab-container.js => afx-tab-container.tag} | 0 .../{afx-tree-view.js => afx-tree-view.tag} | 0 src/core/tags/{afx-vbox.js => afx-vbox.tag} | 0 src/packages/ActivityMonitor/main.coffee | 4 +- src/packages/Blogger/main.coffee | 3 +- src/packages/Blogger/scheme.html | 2 +- src/packages/CodeBlock/main.coffee | 8 +- src/packages/CoreServices/UserService.coffee | 4 +- src/packages/Files/main.coffee | 46 +-- src/packages/MarkOn/main.coffee | 10 +- src/packages/MarketPlace/main.coffee | 4 +- src/packages/NotePad/main.coffee | 10 +- src/packages/Preview/main.coffee | 7 +- 38 files changed, 255 insertions(+), 219 deletions(-) rename src/core/tags/{afx-app-window.js => afx-app-window.tag} (98%) rename src/core/tags/{afx-apps-dock.js => afx-apps-dock.tag} (100%) rename src/core/tags/{afx-button.js => afx-button.tag} (100%) rename src/core/tags/{afx-calendar-view.js => afx-calendar-view.tag} (94%) rename src/core/tags/{afx-color-picker.js => afx-color-picker.tag} (100%) delete mode 100644 src/core/tags/afx-dummy.js create mode 100644 src/core/tags/afx-dummy.tag rename src/core/tags/{afx-file-view.js => afx-file-view.tag} (100%) rename src/core/tags/{afx-float-list.js => afx-float-list.tag} (100%) rename src/core/tags/{afx-grid-view.js => afx-grid-view.tag} (100%) rename src/core/tags/{afx-hbox.js => afx-hbox.tag} (100%) rename src/core/tags/{afx-label.js => afx-label.tag} (76%) rename src/core/tags/{afx-list-view.js => afx-list-view.tag} (100%) rename src/core/tags/{afx-menu.js => afx-menu.tag} (100%) rename src/core/tags/{afx-overlay.js => afx-overlay.tag} (100%) rename src/core/tags/{afx-resizer.js => afx-resizer.tag} (100%) rename src/core/tags/{afx-switch.js => afx-switch.tag} (100%) rename src/core/tags/{afx-sys-panel.js => afx-sys-panel.tag} (95%) rename src/core/tags/{afx-tab-container.js => afx-tab-container.tag} (100%) rename src/core/tags/{afx-tree-view.js => afx-tree-view.tag} (100%) rename src/core/tags/{afx-vbox.js => afx-vbox.tag} (100%) diff --git a/src/core/BaseModel.coffee b/src/core/BaseModel.coffee index a48eb4f..c13b48c 100644 --- a/src/core/BaseModel.coffee +++ b/src/core/BaseModel.coffee @@ -1,5 +1,6 @@ class BaseModel constructor: (@name, @args) -> + me = @ @observable = riot.observable() @_api = self.OS.API @_gui = self.OS.GUI @@ -8,7 +9,8 @@ class BaseModel @on "exit", () -> me.quit() @host = "#desktop" @dialog = undefined - + @subscribe "systemlocalechange", () -> + me.scheme.update() if me.scheme render: (p) -> _GUI.loadScheme p, @, @host diff --git a/src/core/api.coffee b/src/core/api.coffee index af769be..2d5c37f 100644 --- a/src/core/api.coffee +++ b/src/core/api.coffee @@ -31,6 +31,11 @@ if not String.prototype.format args = arguments return @replace /{(\d+)}/g, (match, number) -> return if typeof args[number] != 'undefined' then args[number] else match + +String.prototype.__ = () -> + match = @match(/^__\((.*)\)$/) + return window.__(match[1]) if match + return @ # language directive this.__ = () -> _API = window.OS.API @@ -244,14 +249,16 @@ self.OS.API = onsearch: (name, fn) -> self.OS.API.searchHandler[name] = fn unless self.OS.API.searchHandler[name] - setLocale: (name) -> + setLocale: (name, f) -> path = "resources/languages/#{name}.json" _API.get path, (d) -> - _OS.setting.user.language = name + _OS.setting.system.locale = name _API.lang = d + if f then f() else _courrier.trigger "systemlocalechange" , (e, s) -> - _OS.setting.user.language = "en_GB" + #_OS.setting.system.locale = "en_GB" _courrier.oserror __("Language file {0} not found", path), e, s + f() if f , "json" throwe: (n) -> diff --git a/src/core/gui.coffee b/src/core/gui.coffee index 6deeaa8..cc79c64 100644 --- a/src/core/gui.coffee +++ b/src/core/gui.coffee @@ -9,7 +9,7 @@ self.OS.GUI = META: {} SYS_MENU: [ { - text: __("Applications"), + text: "__(Applications)", child: [], dataid: "sys-apps" iconclass: "fa fa-adn", @@ -340,11 +340,11 @@ self.OS.GUI = _GUI.SYS_MENU[0].child.push v for k, v of _OS.setting.system.packages when (v and v.app) _GUI.SYS_MENU.push v for k, v of _OS.setting.system.menu _GUI.SYS_MENU.push - text: __("Toggle Full screen"), + text: "__(Toggle Full screen)", dataid: "os-fullsize", iconclass: "fa fa-tv" _GUI.SYS_MENU.push - text: __("Log out"), + text: "__(Log out)", dataid: "sys-logout", iconclass: "fa fa-user-times" buildSystemMenu: () -> @@ -384,14 +384,18 @@ self.OS.GUI = # clean up things _OS.cleanup() # get setting from conf - _OS.systemSetting(conf) + _OS.systemSetting conf #console.log _OS.setting # load theme _GUI.loadTheme _OS.setting.appearance.theme # initDM - _GUI.initDM() + _API.setLocale _OS.setting.system.locale, () -> + _GUI.initDM() _courrier.observable.one "syspanelloaded", () -> # TODO load packages list then build system menu + _courrier.observable.on "systemlocalechange", () -> + ($ "#syspanel")[0].update() + _API.packages.cache (ret) -> if ret.result _API.packages.fetch (r) -> diff --git a/src/core/languages/en_GB.json b/src/core/languages/en_GB.json index beeca42..3f31d08 100644 --- a/src/core/languages/en_GB.json +++ b/src/core/languages/en_GB.json @@ -9,6 +9,8 @@ "Application {0} is not executable":"Application {0} is not executable", "Application":"Application", "Applications":"Applications", + "April":"April", + "August":"August", "Authentication":"Authentication", "Cancel":"Cancel", "Cannot Edit category":"Cannot Edit category", @@ -43,6 +45,7 @@ "Copy":"Copy", "Created: {0}":"Created: {0}", "Cut":"Cut", + "December":"December", "Delete a post":"Delete a post", "Delete category":"Delete category", "Delete section":"Delete section", @@ -78,6 +81,7 @@ "Fail to upload to {0}: {1}":"Fail to upload to {0}: {1}", "Fail to write to file: {0}":"Fail to write to file: {0}", "Fail to {0} package":"Fail to {0} package", + "February":"February", "File name":"File name", "File not found {0}":"File not found {0}", "File {0} copied":"File {0} copied", @@ -86,6 +90,7 @@ "Folder name":"Folder name", "Format : [name] url":"Format : [name] url", "Found {0} sections":"Found {0} sections", + "Fri":"Fri", "From":"From", "Full name must be entered":"Full name must be entered", "Full name":"Full name", @@ -96,6 +101,9 @@ "Ignore all {0} unsaved files ?":"Ignore all {0} unsaved files ?", "Install":"Install", "Invalid package: Meta data file not found":"Invalid package: Meta data file not found", + "January":"January", + "July":"July", + "June":"June", "Kill process":"Kill process", "Language file {0} not found":"Language file {0} not found", "Launch":"Launch", @@ -103,8 +111,11 @@ "Location":"Location", "Log out":"Log out", "Logout":"Logout", + "March":"March", + "May":"May", "Mime type {0} is not supported":"Mime type {0} is not supported", "Modify section entry":"Modify section entry", + "Mon":"Mon", "Move to":"Move to", "Name":"Name", "Navigation bar":"Navigation bar", @@ -115,7 +126,9 @@ "No application available to open {0}":"No application available to open {0}", "No post found: {0}":"No post found: {0}", "No":"No", + "November":"November", "OS":"OS", + "October":"October", "Ok":"Ok", "Only {0} could be selected":"Only {0} could be selected", "Open file":"Open file", @@ -147,25 +160,32 @@ "Resource not found {0}":"Resource not found {0}", "Resource not found: {0}":"Resource not found: {0}", "Row {0}, col {1}, lines: {2}":"Row {0}, col {1}, lines: {2}", + "Sat":"Sat", "Save as":"Save as", "Save":"Save", "Section list is empty, please add one":"Section list is empty, please add one", "Select image file":"Select image file", + "Selected: {0} ({1} bytes)":"Selected: {0} ({1} bytes)", + "September":"September", "Service":"Service", "Share file":"Share file", "Shared url: {0}":"Shared url: {0}", "Shared":"Shared", "Short biblio":"Short biblio", "Sidebar":"Sidebar", + "Size":"Size", "Subtitle":"Subtitle", + "Sun":"Sun", "System fail: Cannot init desktop manager":"System fail: Cannot init desktop manager", "System fail: Cannot init login screen":"System fail: Cannot init login screen", "Tags":"Tags", "This feature is not implemented yet":"This feature is not implemented yet", + "Thu":"Thu", "Title or content must not be blank":"Title or content must not be blank", "Title":"Title", "Toggle Full screen":"Toggle Full screen", "Tree view":"Tree view", + "Tue":"Tue", "Type":"Type", "Uninstall : {0}?":"Uninstall : {0}?", "Uninstall":"Uninstall", @@ -189,6 +209,7 @@ "VFS unknown action: {0}":"VFS unknown action: {0}", "VFS unknown handler: {0}":"VFS unknown handler: {0}", "View":"View", + "Wed":"Wed", "Would you like to login to {0}?":"Would you like to login to {0}?", "Wrong format: it should be [name] url":"Wrong format: it should be [name] url", "Yes":"Yes", diff --git a/src/core/languages/gen.sh b/src/core/languages/gen.sh index 16da361..c21ec64 100755 --- a/src/core/languages/gen.sh +++ b/src/core/languages/gen.sh @@ -2,7 +2,7 @@ ord() { LC_CTYPE=C printf '%d' "'$1" } -grep --include=\*.coffee -roh "$1" -e '__("[^"]*"' | while read -r line ; do +grep --include=\*.{coffee,tag} -roh "$1" -e '__("[^"]*"' | while read -r line ; do SUBSTRING=$(echo $line| cut -d'"' -f 2) echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json" done diff --git a/src/core/languages/vi_VN.json b/src/core/languages/vi_VN.json index da8afe6..6ebc7d3 100644 --- a/src/core/languages/vi_VN.json +++ b/src/core/languages/vi_VN.json @@ -43,154 +43,154 @@ "Copy":"Copy", "Created: {0}":"Tạo: {0}", "Cut":"Cắt", - "Delete a post":"Delete a post", - "Delete category":"Delete category", - "Delete section":"Delete section", - "Delete":"Delete", + "Delete a post":"Xoá bài", + "Delete category":"Xoá danh mục", + "Delete section":"Xoá mục", + "Delete":"Xoá", "Desktop":"Desktop", - "Dialog {0} not found":"Dialog {0} not found", - "Do you really want to delete this post ?":"Do you really want to delete this post ?", - "Do you really want to delete: {0}?":"Do you really want to delete: {0}?", - "Download":"Download", - "Edit category":"Edit category", - "Edit repository":"Edit repository", - "Edit":"Edit", + "Dialog {0} not found":"Không tìm thấy hộp thoại {0}", + "Do you really want to delete this post ?":"Bạn muốn xoá bài này ?", + "Do you really want to delete: {0}?":"Bạn muốn xoá: {0}?", + "Download":"Tải về", + "Edit category":"Sửa danh mục", + "Edit repository":"Sửa kho ứng dụng", + "Edit":"Sửa", "Email":"Email", - "Error find app by mimes {0}":"Error find app by mimes {0}", - "Error reading package meta data: {0}":"Error reading package meta data: {0}", - "Error saving file {0}":"Error saving file {0}", - "Exit":"Exit", - "Fail to create directory: {0}":"Fail to create directory: {0}", - "Fail to create {0}: {1}":"Fail to create {0}: {1}", - "Fail to delete {0}: {1}":"Fail to delete {0}: {1}", - "Fail to delete: {0}":"Fail to delete: {0}", - "Fail to fetch packages list from: {0}":"Fail to fetch packages list from: {0}", - "Fail to get file meta data: {0}":"Fail to get file meta data: {0}", - "Fail to make request: {0}":"Fail to make request: {0}", - "Fail to move file: {0} -> {1}":"Fail to move file: {0} -> {1}", - "Fail to paste: {0}":"Fail to paste: {0}", - "Fail to publish file: {0}":"Fail to publish file: {0}", - "Fail to query data from database: {0}":"Fail to query data from database: {0}", - "Fail to read file: {0}":"Fail to read file: {0}", - "Fail to rename to {0}: {1}":"Fail to rename to {0}: {1}", - "Fail to scan directory: {0}":"Fail to scan directory: {0}", - "Fail to upload file to: {0}":"Fail to upload file to: {0}", - "Fail to upload to {0}: {1}":"Fail to upload to {0}: {1}", - "Fail to write to file: {0}":"Fail to write to file: {0}", - "Fail to {0} package":"Fail to {0} package", - "File name":"File name", - "File not found {0}":"File not found {0}", - "File {0} copied":"File {0} copied", - "File {0} cut":"File {0} cut", + "Error find app by mimes {0}":"Lỗi khi tìm app bằng mime {0}", + "Error reading package meta data: {0}":"Lỗi khi đọc thông tin ứng dụng: {0}", + "Error saving file {0}":"Lỗi khi lưu file {0}", + "Exit":"Thoát", + "Fail to create directory: {0}":"Lỗi khi tạo folder: {0}", + "Fail to create {0}: {1}":"Lỗi khi tạo {0}: {1}", + "Fail to delete {0}: {1}":"Lỗi khi xoá {0}: {1}", + "Fail to delete: {0}":"Lỗi khi xoá: {0}", + "Fail to fetch packages list from: {0}":"Lỗi khi tải về danh sách ứng dụng từ: {0}", + "Fail to get file meta data: {0}":"Lỗi truy vấn thông tin file: {0}", + "Fail to make request: {0}":"Lỗi truy vấn: {0}", + "Fail to move file: {0} -> {1}":"Lỗi di chuyển file: {0} -> {1}", + "Fail to paste: {0}":"Lỗi khi dán: {0}", + "Fail to publish file: {0}":"Lỗi khi xuất bản file: {0}", + "Fail to query data from database: {0}":"Lỗi truy vấn cơ sở dữ liệu: {0}", + "Fail to read file: {0}":"Lỗi đọc file: {0}", + "Fail to rename to {0}: {1}":"Lỗi khi đổi tên file {0}: {1}", + "Fail to scan directory: {0}":"Lỗi khi quét thư mục: {0}", + "Fail to upload file to: {0}":"Lỗi khi tải file lên: {0}", + "Fail to upload to {0}: {1}":"Lỗi khi tải file lên {0}: {1}", + "Fail to write to file: {0}":"Lỗi khi ghi file: {0}", + "Fail to {0} package":"Lỗi {0} ứng dụng", + "File name":"Tên file", + "File not found {0}":"Không tìm thấy file {0}", + "File {0} copied":"Đã copy file {0}", + "File {0} cut":"Đã cắt file {0}", "File":"File", - "Folder name":"Folder name", - "Format : [name] url":"Format : [name] url", - "Found {0} sections":"Found {0} sections", - "From":"From", - "Full name must be entered":"Full name must be entered", - "Full name":"Full name", + "Folder name":"Tên thư mục", + "Format : [name] url":"Định dạng : [name] url", + "Found {0} sections":"Tìm thấy {0} mục", + "From":"Từ", + "Full name must be entered":"Vui lòng điền họ và tên", + "Full name":"Họ và tên", "Google Drive":"Google Drive", - "Hidden files":"Hidden files", + "Hidden files":"File ẩn", "Home":"Home", - "Icon view":"Icon view", - "Ignore all {0} unsaved files ?":"Ignore all {0} unsaved files ?", - "Install":"Install", - "Invalid package: Meta data file not found":"Invalid package: Meta data file not found", - "Kill process":"Kill process", - "Language file {0} not found":"Language file {0} not found", - "Launch":"Launch", - "List view":"List view", - "Location":"Location", - "Log out":"Log out", - "Logout":"Logout", - "Mime type {0} is not supported":"Mime type {0} is not supported", - "Modify section entry":"Modify section entry", - "Move to":"Move to", - "Name":"Name", - "Navigation bar":"Navigation bar", - "New file":"New file", - "New folder":"New folder", - "New section entry for {0}":"New section entry for {0}", - "New":"New", - "No application available to open {0}":"No application available to open {0}", - "No post found: {0}":"No post found: {0}", - "No":"No", + "Icon view":"Xêm theo icon", + "Ignore all {0} unsaved files ?":"Bỏ qua {0} file chưa lưu ?", + "Install":"Cài đặt", + "Invalid package: Meta data file not found":"Ứng dụng không hợp lệ: không tìm thấy metadata", + "Kill process":"Đóng process", + "Language file {0} not found":"Không tìm thấy ngôn ngữ {0}", + "Launch":"Khởi chạy", + "List view":"Xem theo list", + "Location":"Vị trí", + "Log out":"Đăng xuất", + "Logout":"Đăng xuất", + "Mime type {0} is not supported":"Mime type {0} không được hổ trợ", + "Modify section entry":"Sửa mục", + "Move to":"Di chuyển vào", + "Name":"Tên", + "Navigation bar":"Thanh điều hướng", + "New file":"File mới", + "New folder":"Thư mục mới", + "New section entry for {0}":"Thêm mới mục trong {0}", + "New":"Tạo mới", + "No application available to open {0}":"Không tìm thấy ứng dụng dể đọc {0}", + "No post found: {0}":"Không tìm thấy bài: {0}", + "No":"Không", "OS":"OS", - "Ok":"Ok", - "Only {0} could be selected":"Only {0} could be selected", - "Open file":"Open file", - "Open with":"Open with", - "Open":"Open", - "Options":"Options", - "Package uninstalled":"Package uninstalled", - "Parent can not be the category itself":"Parent can not be the category itself", - "Paste":"Paste", - "Phone":"Phone", + "Ok":"Có", + "Only {0} could be selected":"Chỉ file với mine {0} mới được chọn", + "Open file":"Mở file", + "Open with":"Mở với", + "Open":"Mở", + "Options":"Tuỳ chọn", + "Package uninstalled":"Đã gỡ bỏ ứng dụng", + "Parent can not be the category itself":"Danh mục cha không được trùng với danh mục hiện tại", + "Paste":"Dán", + "Phone":"Số điện thoại", "Pid":"Pid", - "Please enter category name":"Please enter category name", - "Please enter tags":"Please enter tags", - "Please insert a title in the text: beginning with heading":"Please insert a title in the text: beginning with heading", - "Please select a category":"Please select a category", - "Please select a date":"Please select a date", - "Please select a file":"Please select a file", - "Please select a parent category":"Please select a parent category", - "Please select a section to edit":"Please select a section to edit", - "Please select a section to move":"Please select a section to move", + "Please enter category name":"Vui lòng nhập tên danh mục", + "Please enter tags":"Vui lòng nhập tags", + "Please insert a title in the text: beginning with heading":"Vuil lòng nhập tiêu đề: bắt đầu bài bằng heading", + "Please select a category":"Vui lòng chọn danh mục", + "Please select a date":"Vui lòng chọn ngày", + "Please select a file":"Vui lòng chọn file", + "Please select a parent category":"Vui lòng chọn danh much cha", + "Please select a section to edit":"Vui lòng chọn mục để sửa", + "Please select a section to move":"Vuil lòng chọn mục để di chuyển", "Preview":"Preview", - "Properties":"Properties", - "Quit without saving ?":"Quit without saving ?", - "Quit":"Quit", - "Read more":"Read more", - "Refresh":"Refresh", - "Rename":"Rename", - "Repositories":"Repositories", - "Resource not found {0}":"Resource not found {0}", - "Resource not found: {0}":"Resource not found: {0}", - "Row {0}, col {1}, lines: {2}":"Row {0}, col {1}, lines: {2}", - "Save as":"Save as", - "Save":"Save", - "Section list is empty, please add one":"Section list is empty, please add one", - "Select image file":"Select image file", - "Service":"Service", - "Share file":"Share file", - "Shared url: {0}":"Shared url: {0}", - "Shared":"Shared", - "Short biblio":"Short biblio", + "Properties":"Thông tin", + "Quit without saving ?":"Thoát mà không lưu ?", + "Quit":"Thoát", + "Read more":"Đọc thêm", + "Refresh":"Làm mới", + "Rename":"Đổi tên", + "Repositories":"Các kho ứng dụng", + "Resource not found {0}":"Không tìm thấy tài nguyên {0}", + "Resource not found: {0}":"Không tìm thấy tài nguyên: {0}", + "Row {0}, col {1}, lines: {2}":"Hàng {0}, cột {1}, dòng: {2}", + "Save as":"Lưu như", + "Save":"Lưu", + "Section list is empty, please add one":"Danh sách mục rỗng, vui lòng tạo mới", + "Select image file":"Chọn file ảnh", + "Service":"Dịch vụ", + "Share file":"Chia sẻ", + "Shared url: {0}":"Liên kết chia sẻ: {0}", + "Shared":"Đã chia sẻ", + "Short biblio":"Tiểu sử ngắn", "Sidebar":"Sidebar", - "Subtitle":"Subtitle", - "System fail: Cannot init desktop manager":"System fail: Cannot init desktop manager", - "System fail: Cannot init login screen":"System fail: Cannot init login screen", + "Subtitle":"Tiêu đề con", + "System fail: Cannot init desktop manager":"Lỗi hệ thống: không thể khởi chạy trình quản lý desktop", + "System fail: Cannot init login screen":"Lỗi hệ thống: không thể khởi chạy màn hình đăng nhập", "Tags":"Tags", - "This feature is not implemented yet":"This feature is not implemented yet", - "Title or content must not be blank":"Title or content must not be blank", - "Title":"Title", - "Toggle Full screen":"Toggle Full screen", - "Tree view":"Tree view", - "Type":"Type", - "Uninstall : {0}?":"Uninstall : {0}?", - "Uninstall":"Uninstall", - "Unknown API setting for {0}":"Unknown API setting for {0}", - "Updated: {0}":"Updated: {0}", - "Upload":"Upload", + "This feature is not implemented yet":"Chức năng này chưa được cài đặt", + "Title or content must not be blank":"Tiêu đề hoặc nội dụng không được để trống", + "Title":"Tiêu đề", + "Toggle Full screen":"Bật/tắt toàn màn hình", + "Tree view":"Xem theo cây", + "Type":"Loại", + "Uninstall : {0}?":"Gỡ cài đặt : {0}?", + "Uninstall":"Gỡ cài đặt", + "Unknown API setting for {0}":"Không tìm thấy cài đặt API của {0}", + "Updated: {0}":"Đã cập nhật: {0}", + "Upload":"Tải lên", "Url":"Url", - "User abort the authentication":"User abort the authentication", - "User data updated":"User data updated", - "VDB Unknown condition for delete command":"VDB Unknown condition for delete command", - "VFS Cannot encode file: {0}":"VFS Cannot encode file: {0}", - "VFS cannot create : {0}":"VFS cannot create : {0}", - "VFS cannot delete : {0}":"VFS cannot delete : {0}", - "VFS cannot download file : {0}":"VFS cannot download file : {0}", - "VFS cannot get meta data for {0}":"VFS cannot get meta data for {0}", - "VFS cannot init {0}: {1}":"VFS cannot init {0}: {1}", - "VFS cannot move : {0}":"VFS cannot move : {0}", - "VFS cannot read : {0}":"VFS cannot read : {0}", - "VFS cannot save : {0}":"VFS cannot save : {0}", - "VFS cannot write : {0}":"VFS cannot write : {0}", - "VFS unknown action: {0}":"VFS unknown action: {0}", - "VFS unknown handler: {0}":"VFS unknown handler: {0}", - "View":"View", - "Would you like to login to {0}?":"Would you like to login to {0}?", - "Wrong format: it should be [name] url":"Wrong format: it should be [name] url", - "Yes":"Yes", - "{0} is not a directory":"{0} is not a directory" -} + "User abort the authentication":"Người dùng huỷ xác thực", + "User data updated":"Thông tin người dùng đã được cập nhật", + "VDB Unknown condition for delete command":"VDB không rõ điều kiện cho lệnh xoá", + "VFS Cannot encode file: {0}":"VFS Không thể mã hoá file: {0}", + "VFS cannot create : {0}":"VFS không thể tạo : {0}", + "VFS cannot delete : {0}":"VFS không thể xoá : {0}", + "VFS cannot download file : {0}":"VFS không thể tải về : {0}", + "VFS cannot get meta data for {0}":"VFS không thể truy vấn thông tin của {0}", + "VFS cannot init {0}: {1}":"VFS không thể khởi động {0}: {1}", + "VFS cannot move : {0}":"VFS không thể di chuyển : {0}", + "VFS cannot read : {0}":"VFS không thể đọc : {0}", + "VFS cannot save : {0}":"VFS không thể lưu : {0}", + "VFS cannot write : {0}":"VFS không thể viết : {0}", + "VFS unknown action: {0}":"VFS không rõ hành động : {0}", + "VFS unknown handler: {0}":"VFS không rõ trình xữ lý: {0}", + "View":"Xem", + "Would you like to login to {0}?":"Bạn có muốn đăng nhập vào {0}?", + "Wrong format: it should be [name] url":"Sai định dạng: định dạng hợp lệ [name] url", + "Yes":"Có", + "{0} is not a directory":"{0} không phải là thư mục" +} \ No newline at end of file diff --git a/src/core/settings.coffee b/src/core/settings.coffee index b413b4a..7f31306 100644 --- a/src/core/settings.coffee +++ b/src/core/settings.coffee @@ -3,7 +3,6 @@ _OS.setting.applications = conf.applications if conf.applications _OS.setting.appearance = conf.appearance if conf.appearance _OS.setting.user = conf.user - _OS.setting.user.language = "en_GB" unless conf.user.language _OS.setting.VFS = conf.VFS if conf.VFS _OS.setting.desktop.path = "home:///.desktop" unless _OS.setting.desktop.path _OS.setting.desktop.menu = {} unless _OS.setting.desktop.menu @@ -32,6 +31,7 @@ user: "home:///.packages", system: "os:///packages" } unless _OS.setting.system.pkgpaths + _OS.setting.system.locale = "en_GB" unless _OS.setting.system.locale _OS.setting.system.menu = {} unless _OS.setting.system.menu _OS.setting.system.repositories = [] unless _OS.setting.system.repositories _OS.setting.appearance.theme = "antos" unless _OS.setting.appearance.theme @@ -45,7 +45,7 @@ } unless _OS.setting.VFS.gdrive #search for app - _API.onsearch __("Applications"), (t) -> + _API.onsearch "__(Applications)", (t) -> ar = [] term = new RegExp t, "i" for k, v of _OS.setting.system.packages when v.app diff --git a/src/core/tags/afx-app-window.js b/src/core/tags/afx-app-window.tag similarity index 98% rename from src/core/tags/afx-app-window.js rename to src/core/tags/afx-app-window.tag index 3a9f91d..fc86dc1 100644 --- a/src/core/tags/afx-app-window.js +++ b/src/core/tags/afx-app-window.tag @@ -4,7 +4,7 @@
  • -
  • { apptitle }
  • +
  • { apptitle?apptitle.toString().__():apptitle }
  • @@ -49,6 +49,10 @@ { return self[k] } + self.root.update = function() + { + self.update() + } minimize() { this.root.observable.trigger("hide") diff --git a/src/core/tags/afx-apps-dock.js b/src/core/tags/afx-apps-dock.tag similarity index 100% rename from src/core/tags/afx-apps-dock.js rename to src/core/tags/afx-apps-dock.tag diff --git a/src/core/tags/afx-button.js b/src/core/tags/afx-button.tag similarity index 100% rename from src/core/tags/afx-button.js rename to src/core/tags/afx-button.tag diff --git a/src/core/tags/afx-calendar-view.js b/src/core/tags/afx-calendar-view.tag similarity index 94% rename from src/core/tags/afx-calendar-view.js rename to src/core/tags/afx-calendar-view.tag index 050bb18..1dc9257 100644 --- a/src/core/tags/afx-calendar-view.js +++ b/src/core/tags/afx-calendar-view.tag @@ -62,7 +62,7 @@ self.year = date.getFullYear() var now ={ d:(new Date()).getDate(), m:(new Date()).getMonth(), y:(new Date()).getFullYear()} - months = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')] + months = [__("January"), __("February"), __("March"), __("April"), __("May"), __("June"), __("July"), __("August"), __("September"), __("October"), __("November"), __("December")] this_month = new Date(self.year, self.month, 1) next_month = new Date(self.year, self.month + 1, 1) diff --git a/src/core/tags/afx-color-picker.js b/src/core/tags/afx-color-picker.tag similarity index 100% rename from src/core/tags/afx-color-picker.js rename to src/core/tags/afx-color-picker.tag diff --git a/src/core/tags/afx-dummy.js b/src/core/tags/afx-dummy.js deleted file mode 100644 index b697ced..0000000 --- a/src/core/tags/afx-dummy.js +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/core/tags/afx-dummy.tag b/src/core/tags/afx-dummy.tag new file mode 100644 index 0000000..5bf4fa0 --- /dev/null +++ b/src/core/tags/afx-dummy.tag @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/src/core/tags/afx-file-view.js b/src/core/tags/afx-file-view.tag similarity index 100% rename from src/core/tags/afx-file-view.js rename to src/core/tags/afx-file-view.tag diff --git a/src/core/tags/afx-float-list.js b/src/core/tags/afx-float-list.tag similarity index 100% rename from src/core/tags/afx-float-list.js rename to src/core/tags/afx-float-list.tag diff --git a/src/core/tags/afx-grid-view.js b/src/core/tags/afx-grid-view.tag similarity index 100% rename from src/core/tags/afx-grid-view.js rename to src/core/tags/afx-grid-view.tag diff --git a/src/core/tags/afx-hbox.js b/src/core/tags/afx-hbox.tag similarity index 100% rename from src/core/tags/afx-hbox.js rename to src/core/tags/afx-hbox.tag diff --git a/src/core/tags/afx-label.js b/src/core/tags/afx-label.tag similarity index 76% rename from src/core/tags/afx-label.js rename to src/core/tags/afx-label.tag index aa965af..6208cb6 100644 --- a/src/core/tags/afx-label.js +++ b/src/core/tags/afx-label.tag @@ -2,7 +2,7 @@ - { parse(text) } + { text?text.toString().__():"" } \ No newline at end of file diff --git a/src/core/tags/afx-list-view.js b/src/core/tags/afx-list-view.tag similarity index 100% rename from src/core/tags/afx-list-view.js rename to src/core/tags/afx-list-view.tag diff --git a/src/core/tags/afx-menu.js b/src/core/tags/afx-menu.tag similarity index 100% rename from src/core/tags/afx-menu.js rename to src/core/tags/afx-menu.tag diff --git a/src/core/tags/afx-overlay.js b/src/core/tags/afx-overlay.tag similarity index 100% rename from src/core/tags/afx-overlay.js rename to src/core/tags/afx-overlay.tag diff --git a/src/core/tags/afx-resizer.js b/src/core/tags/afx-resizer.tag similarity index 100% rename from src/core/tags/afx-resizer.js rename to src/core/tags/afx-resizer.tag diff --git a/src/core/tags/afx-switch.js b/src/core/tags/afx-switch.tag similarity index 100% rename from src/core/tags/afx-switch.js rename to src/core/tags/afx-switch.tag diff --git a/src/core/tags/afx-sys-panel.js b/src/core/tags/afx-sys-panel.tag similarity index 95% rename from src/core/tags/afx-sys-panel.js rename to src/core/tags/afx-sys-panel.tag index 6391aff..a10e19d 100644 --- a/src/core/tags/afx-sys-panel.js +++ b/src/core/tags/afx-sys-panel.tag @@ -39,6 +39,10 @@ { return self[k] } + self.root.update = function() + { + self.update() + } this.on('mount', function() { //console.log(self.refs.aOsmenu.root) $(self.refs.aOsmenu.root).css("z-index",1000000) diff --git a/src/core/tags/afx-tab-container.js b/src/core/tags/afx-tab-container.tag similarity index 100% rename from src/core/tags/afx-tab-container.js rename to src/core/tags/afx-tab-container.tag diff --git a/src/core/tags/afx-tree-view.js b/src/core/tags/afx-tree-view.tag similarity index 100% rename from src/core/tags/afx-tree-view.js rename to src/core/tags/afx-tree-view.tag diff --git a/src/core/tags/afx-vbox.js b/src/core/tags/afx-vbox.tag similarity index 100% rename from src/core/tags/afx-vbox.js rename to src/core/tags/afx-vbox.tag diff --git a/src/packages/ActivityMonitor/main.coffee b/src/packages/ActivityMonitor/main.coffee index eb88ace..b598fa4 100644 --- a/src/packages/ActivityMonitor/main.coffee +++ b/src/packages/ActivityMonitor/main.coffee @@ -14,7 +14,7 @@ class ActivityMonitor extends this.OS.GUI.BaseApplication app = _PM.appByPid item[0].value app.quit() if app - header = [{width:50,value:__("Pid")},{value:__("Name")}, {value:__("Type"), width:80},{width:75,value:__("Alive (ms)")}] + header = [{width:50,value: "__(Pid)"},{value:"__(Name)"}, {value:"__(Type)", width:80},{width:75,value: "__(Alive (ms))"}] @gdata = processes:{} alive:[] @@ -36,7 +36,7 @@ class ActivityMonitor extends this.OS.GUI.BaseApplication {icon:if _APP[a.name].type == 1 then _APP[a.name].meta.icon else a.icon, iconclass:if _APP[a.name].type == 1 then _APP[a.name].meta.iconclass else a.iconclass, value:a.name}, - {value: if _APP[a.name].type == 1 then __("Application") else __("Service")} + {value: if _APP[a.name].type == 1 then "__(Application)" else "__(Service)"} {value: now - a.birth} ] me.gdata.alive.push a.pid diff --git a/src/packages/Blogger/main.coffee b/src/packages/Blogger/main.coffee index 6c4a76e..ff8d7c3 100644 --- a/src/packages/Blogger/main.coffee +++ b/src/packages/Blogger/main.coffee @@ -60,7 +60,7 @@ class Blogger extends this.OS.GUI.BaseApplication me.cvcatdb.save c, (r) -> return me.error __("Cannot Edit category") if r.error - me.refreshCVCat() + me.refreshCVCat() , __("Edit category"), { tree: (me.cvlist.get "data"), cat: cat } (@find "cv-cat-del").set "onbtclick", (e) -> @@ -378,7 +378,6 @@ class Blogger extends this.OS.GUI.BaseApplication ] @blogdb.find cond, (r) -> return me.notify __("No post found: {0}", r.error) if r.error - console.log r.result for v in r.result v.text = v.title v.complex = true diff --git a/src/packages/Blogger/scheme.html b/src/packages/Blogger/scheme.html index 6bde548..8917635 100644 --- a/src/packages/Blogger/scheme.html +++ b/src/packages/Blogger/scheme.html @@ -28,7 +28,7 @@