From cbcec9ef4835e976f92d660afeb209c5bddfec30 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Thu, 21 Aug 2014 23:27:39 +0200 Subject: [PATCH 1/7] Create package.json --- .../samples/LocalizationExample/package.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/extensions/samples/LocalizationExample/package.json diff --git a/src/extensions/samples/LocalizationExample/package.json b/src/extensions/samples/LocalizationExample/package.json new file mode 100644 index 00000000000..1da4255f62b --- /dev/null +++ b/src/extensions/samples/LocalizationExample/package.json @@ -0,0 +1,16 @@ +{ + "name": "localization-example", + "title": "LocalizationExample", + "description": "LocalizationExample.", + "homepage": "https://github.com/adobe/brackets/tree/master/src/extensions/samples/LocalizationExample", + "version": "1.0.0", + "author": "", + "license": "MIT", + "engines": { + "brackets": ">=0.42.0" + }, + "i18n": [ + "en", + "fr" + ] +} From 5c0fd1bc8bcb77059fbc7072642563abe6d36e04 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Thu, 21 Aug 2014 23:38:33 +0200 Subject: [PATCH 2/7] Update README.md --- src/extensions/samples/LocalizationExample/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extensions/samples/LocalizationExample/README.md b/src/extensions/samples/LocalizationExample/README.md index 3cdb945af75..558894e45bf 100644 --- a/src/extensions/samples/LocalizationExample/README.md +++ b/src/extensions/samples/LocalizationExample/README.md @@ -48,6 +48,8 @@ Move this plugin to the extensions\user\ folder to run the plugin. It will add a * main.js – loads the Strings module for the plugin and uses mustache to localize html content +* package.json - add the translation languages as in the example: `"i18n: ["en", "fr" ]` + * strings.js – uses i18n to load a strings.js file in the nls folder * htmlContent From e96687903496a2d606b29400917b4e4dcab7f3a3 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Fri, 22 Aug 2014 14:06:56 +0200 Subject: [PATCH 3/7] Update package.json --- src/extensions/samples/LocalizationExample/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/samples/LocalizationExample/package.json b/src/extensions/samples/LocalizationExample/package.json index 1da4255f62b..a94be9b40ad 100644 --- a/src/extensions/samples/LocalizationExample/package.json +++ b/src/extensions/samples/LocalizationExample/package.json @@ -10,7 +10,7 @@ "brackets": ">=0.42.0" }, "i18n": [ - "en", - "fr" + "en", + "fr" ] } From baa6ad532dd4302f5282fd1a52715e32e4243ef7 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Sat, 23 Aug 2014 14:05:22 +0200 Subject: [PATCH 4/7] Update README.md --- .../samples/LocalizationExample/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/extensions/samples/LocalizationExample/README.md b/src/extensions/samples/LocalizationExample/README.md index 558894e45bf..1a9fcbdd3d7 100644 --- a/src/extensions/samples/LocalizationExample/README.md +++ b/src/extensions/samples/LocalizationExample/README.md @@ -52,15 +52,15 @@ Move this plugin to the extensions\user\ folder to run the plugin. It will add a * strings.js – uses i18n to load a strings.js file in the nls folder -* htmlContent - * htmlfragment.html – html template to be localized by mustache - * nls - * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin - * root + * htmlContent + * htmlfragment.html – html template to be localized by mustache + * nls + * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin + * root * strings.js – contains the English strings - * fr + * fr * strings.js – contains the French strings - * etc. for each locale + * etc. for each locale #### Strings for plugins vs Brackets Note that there is a distinction between loading strings for a plugin vs. strings in the Brackets core. To access strings local to your plugin use `var strings = require("strings")`. To load the core Brackets strings use `var bracketsStrings = brackets.getModule("strings")` From c0ca4d189f6858992cd4e64017d44fa09a6fcee7 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Thu, 28 Aug 2014 16:58:12 +0200 Subject: [PATCH 5/7] Update README.md --- .../samples/LocalizationExample/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/extensions/samples/LocalizationExample/README.md b/src/extensions/samples/LocalizationExample/README.md index 1a9fcbdd3d7..cb4dc1e0d79 100644 --- a/src/extensions/samples/LocalizationExample/README.md +++ b/src/extensions/samples/LocalizationExample/README.md @@ -54,13 +54,13 @@ Move this plugin to the extensions\user\ folder to run the plugin. It will add a * htmlContent * htmlfragment.html – html template to be localized by mustache - * nls - * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin - * root - * strings.js – contains the English strings - * fr - * strings.js – contains the French strings - * etc. for each locale + * nls + * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin + * root + * strings.js – contains the English strings + * fr + * strings.js – contains the French strings + * etc. for each locale #### Strings for plugins vs Brackets Note that there is a distinction between loading strings for a plugin vs. strings in the Brackets core. To access strings local to your plugin use `var strings = require("strings")`. To load the core Brackets strings use `var bracketsStrings = brackets.getModule("strings")` From dbcbbd9c4a03cf0a1c15a1dec47aca862d668126 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Thu, 28 Aug 2014 16:59:39 +0200 Subject: [PATCH 6/7] Update package.json --- src/extensions/samples/LocalizationExample/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/samples/LocalizationExample/package.json b/src/extensions/samples/LocalizationExample/package.json index a94be9b40ad..83b2020cb02 100644 --- a/src/extensions/samples/LocalizationExample/package.json +++ b/src/extensions/samples/LocalizationExample/package.json @@ -1,10 +1,10 @@ { "name": "localization-example", - "title": "LocalizationExample", - "description": "LocalizationExample.", + "title": "Localization Example", + "description": "A guide on how to localize your extension.", "homepage": "https://github.com/adobe/brackets/tree/master/src/extensions/samples/LocalizationExample", "version": "1.0.0", - "author": "", + "author": "The Brackets team", "license": "MIT", "engines": { "brackets": ">=0.42.0" From f122452ac9752eef6259985a3dcc1af06ad60378 Mon Sep 17 00:00:00 2001 From: Denisov21 Date: Sat, 30 Aug 2014 14:35:10 +0200 Subject: [PATCH 7/7] Update README.md --- .../samples/LocalizationExample/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/extensions/samples/LocalizationExample/README.md b/src/extensions/samples/LocalizationExample/README.md index cb4dc1e0d79..941199704a5 100644 --- a/src/extensions/samples/LocalizationExample/README.md +++ b/src/extensions/samples/LocalizationExample/README.md @@ -52,15 +52,15 @@ Move this plugin to the extensions\user\ folder to run the plugin. It will add a * strings.js – uses i18n to load a strings.js file in the nls folder - * htmlContent - * htmlfragment.html – html template to be localized by mustache - * nls - * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin - * root - * strings.js – contains the English strings - * fr - * strings.js – contains the French strings - * etc. for each locale +* htmlContent + * htmlfragment.html – html template to be localized by mustache +* nls + * strings.js – configures i18n by specifying the root folder and listing the locales supported by the plugin + * root + * strings.js – contains the English strings + * fr + * strings.js – contains the French strings + * etc. for each locale #### Strings for plugins vs Brackets Note that there is a distinction between loading strings for a plugin vs. strings in the Brackets core. To access strings local to your plugin use `var strings = require("strings")`. To load the core Brackets strings use `var bracketsStrings = brackets.getModule("strings")`