all packages now support localisation

This commit is contained in:
Xuan Sang LE
2018-03-10 01:05:34 +01:00
parent 9e0cd29030
commit d072566be8
19 changed files with 539 additions and 276 deletions

View File

@ -87,7 +87,7 @@ class PromptDialog extends BasicDialog
resizable: false,
buttons: [
{
label: __("0k"),
label: __("Ok"),
onclick: (d) ->
txt = (d.find "content1").value
return d.quit() if txt is ""

View File

@ -37,10 +37,9 @@ this.__ = () ->
args = arguments
return "Undefined" unless args.length > 0
d = args[0]
h = if typeof d is "string" then d.hash() else d
_API.lang[h] = d unless _API.lang[h]
return _API.lang[h] unless args.length > 1
return String.prototype.format.apply _API.lang[h], (args[i] for i in [1 .. args.length - 1])
_API.lang[d] = d unless _API.lang[d]
return _API.lang[d] unless args.length > 1
return String.prototype.format.apply _API.lang[d], (args[i] for i in [1 .. args.length - 1])
Date.prototype.toString = () ->
dd = @getDate()
@ -245,12 +244,13 @@ self.OS.API =
onsearch: (name, fn) ->
self.OS.API.searchHandler[name] = fn unless self.OS.API.searchHandler[name]
setLanguage: (name) ->
setLocale: (name) ->
path = "resources/languages/#{name}.json"
_API.get path, (d) ->
_OS.setting.user.language = name
_API.lang = d
, (e, s) ->
_OS.setting.user.language = "en_GB"
_courrier.oserror __("Language file {0} not found", path), e, s
, "json"

View File

@ -1,133 +0,0 @@
{
"182526600":"About",
"1728416751":"Logout",
"374360126":"This feature is not implemented yet",
"193429273":"New",
"2087881073":"Open",
"2087429796":"Save",
"2752946774":"Save as",
"193404632":"Pid",
"2087422178":"Name",
"2087427261":"Type",
"2843369965":"Alive (ms)",
"2535492479":"Application",
"3856720312":"Service",
"3424459089":"Cannot add new category",
"463938484":"Add category",
"363586160":"Cannot Edit category",
"2424497641":"Edit category",
"3805835340":"Delete category",
"2240681887":"Do you really want to delete: {0}?",
"3156273522":"Please select a category",
"4164367416":"Cannot save section: {0}",
"1192966569":"New section entry for {0}",
"2824455713":"Please select a section to move",
"1501625444":"Cannot move section",
"808187119":"Move to",
"300219980":"Please select a section to edit",
"135303592":"Modify section entry",
"1766808808":"Cannot export file for embeding to text",
"1217236556":"Select image file",
"1968305551":"Preview",
"4222677540":"Cannot fetch the entry content",
"912714953":"Cannot delete: {0}",
"3999757701":"Delete a post",
"3306560909":"Do you really want to delete this post ?",
"3727585409":"Cannot fetch user data",
"2639330688":"Full name must be entered",
"3465321180":"Cannot save user data",
"2286635345":"User data updated",
"2963875715":"Cannot fetch CV categories",
"2893553849":"Cannot delete all content of: {0} [{1}]",
"1900521681":"Cannot delete the category: {0} [{1}]",
"3357186118":"Section list is empty, please add one",
"3413006975":"Found {0} sections",
"1144919321":"Cannot delete the section: {0}",
"2644553141":"Delete section",
"3876829319":"Please insert a title in the text: beginning with heading",
"3245026722":"Please enter tags",
"1973052887":"Cannot save blog: {0}",
"2178779206":"No post found: {0}",
"3030608041":"Created: {0}",
"3030607100":"Updated: {0}",
"2531202798":"Please select a parent category",
"3588217300":"Please enter category name",
"4030690575":"Parent can not be the category itself",
"2422876246":"Title or content must not be blank",
"1873707161":"Cannot load 3rd library at: {0}",
"657074596":"Language file {0} not found",
"1322116428":"Applications",
"2087421738":"Home",
"2601558679":"Desktop",
"5862649":"OS",
"3390737312":"Google Drive",
"1121690732":"Shared",
"5861310":"0k",
"1434146403":"Cancel",
"2144977206":"Please select a date",
"193433354":"Yes",
"5861188":"No",
"5861313":"Ok",
"3689040132":"About: {0}",
"3772680544":"Resource not found: {0}",
"2523816740":"Please select a file",
"1865792728":"Only {0} could be selected",
"4229049240":"Dialog {0} not found",
"2838461131":"VDB Unknown condition for delete command",
"2960050010":"VFS unknown handler: {0}",
"1343590195":"VFS Cannot encode file: {0}",
"173279772":"VFS unknown action: {0}",
"4019955188":"{0} is not a directory",
"83405614":"Unknown API setting for {0}",
"3786481511":"User abort the authentication",
"4162337765":"Authentication",
"2930246978":"Would you like to login to {0}?",
"2202007582":"VFS cannot init {0}: {1}",
"2790700937":"VFS cannot get meta data for {0}",
"364661042":"VFS cannot save : {0}",
"3957553505":"VFS cannot read : {0}",
"4093931543":"VFS cannot create : {0}",
"4069871534":"VFS cannot write : {0}",
"2117555914":"VFS cannot delete : {0}",
"3287790145":"VFS cannot download file : {0}",
"894347874":"VFS cannot move : {0}",
"3486928966":"Fail to scan directory: {0}",
"3755150205":"Fail to create directory: {0}",
"3480594191":"Fail to publish file: {0}",
"2765007501":"Fail to get file meta data: {0}",
"3576800228":"Fail to read file: {0}",
"1708235907":"Fail to move file: {0} -> {1}",
"2173516457":"Fail to delete: {0}",
"3625310256":"Fail to {0} package",
"3500805390":"Fail to upload file to: {0}",
"166470768":"Fail to write to file: {0}",
"1533928590":"Cannot save system setting",
"4029431747":"Fail to make request: {0}",
"3283805977":"Fail to query data from database: {0}",
"2087960229":"Exit",
"2772420848":"Cannot read service script: {0}",
"2458026955":"Error find app by mimes {0}",
"1570757462":"Application {0} is not executable",
"1037620478":"No application available to open {0}",
"759608531":"Open with",
"1346677432":"Refresh",
"2941901658":"System fail: Cannot init desktop manager",
"3474507048":"Toggle Full screen",
"1205381487":"Log out",
"1949044628":"System fail: Cannot init login screen",
"4008767138":"Read more",
"566874284":"Kill process",
"165499909":"Title",
"3336612961":"Subtitle",
"69825113":"(Location)",
"2087699155":"From",
"4219309361":"Full name",
"2117088275":"Address",
"165407801":"Phone",
"173181097":"Email",
"193413550":"Url",
"2454725172":"Short biblio",
"3455523987":"Categories",
"2088336676":"Tags"
}

View File

@ -1,26 +0,0 @@
#!/bin/bash
ord() {
LC_CTYPE=C printf '%d' "'$1"
}
hash(){
text=$1
node -e "var hash, i, text;text='$1';hash = 5381;i = text.length;while (i) {hash = (hash * 33) ^ text.charCodeAt(--i);}; console.log(hash >>> 0)"
}
echo "{" > "tmp.json"
grep --include=\*.coffee -roh "$1" -e '__("[^"]*"' |while read -r line ; do
SUBSTRING=$(echo $line| cut -d'"' -f 2)
hs=$(hash "$SUBSTRING")
echo -e "\t\"$hs\":\"$SUBSTRING\"," >> "tmp.json"
done
grep --include=\*.html -roh './src/' -e '"__(.*)"' | while read -r line; do
SUBSTRING=${line:4:-2}
hs=$(hash "$SUBSTRING")
echo -e "\t\"$hs\":\"$SUBSTRING\"," >> "tmp.json"
done
echo "}" >> "tmp.json"
# remove duplicate entry
echo "remove duplicate line"
echo ""> $2
awk '!a[$0]++' "tmp.json" >> $2
rm tmp.json

View File

@ -0,0 +1,196 @@
{
"About":"About",
"About: {0}":"About: {0}",
"Add category":"Add category",
"Add repository":"Add repository",
"Address":"Address",
"Alive (ms)":"Alive (ms)",
"Application installed":"Application installed",
"Application {0} is not executable":"Application {0} is not executable",
"Application":"Application",
"Applications":"Applications",
"Authentication":"Authentication",
"Cancel":"Cancel",
"Cannot Edit category":"Cannot Edit category",
"Cannot add new category":"Cannot add new category",
"Cannot create {0}":"Cannot create {0}",
"Cannot delete all content of: {0} [{1}]":"Cannot delete all content of: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Cannot delete the category: {0} [{1}]",
"Cannot delete the section: {0}":"Cannot delete the section: {0}",
"Cannot delete: {0}":"Cannot delete: {0}",
"Cannot down load the app {0}":"Cannot down load the app {0}",
"Cannot export file for embedding to text":"Cannot export file for embedding to text",
"Cannot fetch CV categories":"Cannot fetch CV categories",
"Cannot fetch the entry content":"Cannot fetch the entry content",
"Cannot fetch user data":"Cannot fetch user data",
"Cannot install {0}":"Cannot install {0}",
"Cannot load 3rd library at: {0}":"Cannot load 3rd library at: {0}",
"Cannot move section":"Cannot move section",
"Cannot read service script: {0}":"Cannot read service script: {0}",
"Cannot render the PDF file":"Cannot render the PDF file",
"Cannot save blog: {0}":"Cannot save blog: {0}",
"Cannot save section: {0}":"Cannot save section: {0}",
"Cannot save system setting":"Cannot save system setting",
"Cannot save user data":"Cannot save user data",
"Cannot share file: {0}":"Cannot share file: {0}",
"Cannot uninstall package: {0}":"Cannot uninstall package: {0}",
"Categories":"Categories",
"Clear all":"Clear all",
"Close tab":"Close tab",
"Close without saving ?":"Close without saving ?",
"Close":"Close",
"Copy not yet implemented":"Copy not yet implemented",
"Copy":"Copy",
"Created: {0}":"Created: {0}",
"Cut":"Cut",
"Delete a post":"Delete a post",
"Delete category":"Delete category",
"Delete section":"Delete section",
"Delete":"Delete",
"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",
"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",
"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",
"Google Drive":"Google Drive",
"Hidden files":"Hidden files",
"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",
"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",
"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",
"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",
"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",
"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",
"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"
}

View File

@ -0,0 +1,196 @@
{
"About":"About",
"About: {0}":"About: {0}",
"Add category":"Add category",
"Add repository":"Add repository",
"Address":"Address",
"Alive (ms)":"Alive (ms)",
"Application installed":"Application installed",
"Application {0} is not executable":"Application {0} is not executable",
"Application":"Application",
"Applications":"Applications",
"Authentication":"Authentication",
"Cancel":"Cancel",
"Cannot Edit category":"Cannot Edit category",
"Cannot add new category":"Cannot add new category",
"Cannot create {0}":"Cannot create {0}",
"Cannot delete all content of: {0} [{1}]":"Cannot delete all content of: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Cannot delete the category: {0} [{1}]",
"Cannot delete the section: {0}":"Cannot delete the section: {0}",
"Cannot delete: {0}":"Cannot delete: {0}",
"Cannot down load the app {0}":"Cannot down load the app {0}",
"Cannot export file for embedding to text":"Cannot export file for embedding to text",
"Cannot fetch CV categories":"Cannot fetch CV categories",
"Cannot fetch the entry content":"Cannot fetch the entry content",
"Cannot fetch user data":"Cannot fetch user data",
"Cannot install {0}":"Cannot install {0}",
"Cannot load 3rd library at: {0}":"Cannot load 3rd library at: {0}",
"Cannot move section":"Cannot move section",
"Cannot read service script: {0}":"Cannot read service script: {0}",
"Cannot render the PDF file":"Cannot render the PDF file",
"Cannot save blog: {0}":"Cannot save blog: {0}",
"Cannot save section: {0}":"Cannot save section: {0}",
"Cannot save system setting":"Cannot save system setting",
"Cannot save user data":"Cannot save user data",
"Cannot share file: {0}":"Cannot share file: {0}",
"Cannot uninstall package: {0}":"Cannot uninstall package: {0}",
"Categories":"Categories",
"Clear all":"Clear all",
"Close tab":"Close tab",
"Close without saving ?":"Close without saving ?",
"Close":"Close",
"Copy not yet implemented":"Copy not yet implemented",
"Copy":"Copy",
"Created: {0}":"Created: {0}",
"Cut":"Cut",
"Delete a post":"Delete a post",
"Delete category":"Delete category",
"Delete section":"Delete section",
"Delete":"Delete",
"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",
"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",
"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",
"Google Drive":"Google Drive",
"Hidden files":"Hidden files",
"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",
"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",
"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",
"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",
"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",
"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",
"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"
}

24
src/core/languages/gen.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
ord() {
LC_CTYPE=C printf '%d' "'$1"
}
grep --include=\*.coffee -roh "$1" -e '__("[^"]*"' | while read -r line ; do
SUBSTRING=$(echo $line| cut -d'"' -f 2)
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
done
grep --include=\*.{coffee,html} -roh "$1" -e '"__(.*)"' | while read -r line; do
len=$(( ${#line} - 6 ))
#echo $len
SUBSTRING=${line:4:len}
#echo $SUBSTRING
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
done
sort tmp.json > tmp1.json
awk '!a[$0]++' "tmp1.json" > tmp.json
sed '$ s/.$//' tmp.json > tmp1.json
# remove duplicate entry
echo "remove duplicate line"
echo "{"> $2
cat tmp1.json >> $2
echo "}" >> $2
rm tmp.json tmp1.json

View File

@ -200,7 +200,7 @@
if(self.onfileselect)
self.onfileselect(e.data)
$(self.refs.stbar).empty()
$(self.refs.stbar).append($("<span>").append(__("Selected: {0} ({1} bytes)", e.data.filename, e.data.size)))//.html()
$(self.refs.stbar).append($("<span>").append(__("Selected: {0} ({1} bytes)", e.data.filename, e.data.size?e.data.size:"0")))//.html()
})
self.root.observable.on("filedbclick", function(e){
if(e.id != self.rid ) return

View File

@ -32,7 +32,7 @@
parse(text)
{
if(!text) return ""
match = text.match(/^__\(([^\)]*)\)$/)
match = text.toString().match(/^__\((.*)\)$/)
if(match)
{
return window.__(match[1])