Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Update in LocalizationExample #8828

Merged
merged 7 commits into from Aug 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/extensions/samples/LocalizationExample/README.md
Expand Up @@ -48,17 +48,19 @@ 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" ]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may point out that this step is optional.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything here is optional. But if you are adding translations, is better if you add this.


* strings.js – uses i18n to load a strings.js file in the nls folder

* htmlContent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an error from before. But since you are editing this file, would you mind fixing the indentation here? This and the next line should be indented 4 more spaces. Thanks

* 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")`
Expand Down
16 changes: 16 additions & 0 deletions src/extensions/samples/LocalizationExample/package.json
@@ -0,0 +1,16 @@
{
"name": "localization-example",
"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": "The Brackets team",
"license": "MIT",
"engines": {
"brackets": ">=0.42.0"
},
"i18n": [
"en",
"fr"
]
}