Last active
February 17, 2017 11:26
-
-
Save 0-Sony/465e3659c180061a5e52 to your computer and use it in GitHub Desktop.
Js translate. An Example to translate js into js file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Build your Js **/ | |
alert(Translator.translate('My Text to translate')); | |
alert(Translator.translate('Another Text to translate')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Namespace/Module/etc/config.xml --> | |
<!-- Optional. Only if you want specify a csv file --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<config> | |
<frontend> | |
<translate> | |
<modules> | |
<namespace_module> | |
<files> | |
<default> | |
Namespace_Module.csv | |
</default> | |
</files> | |
</namespace_module> | |
</modules> | |
</translate> | |
</frontend> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Namespace/Module/etc/jstranslator.xml --> | |
<?xml version="1.0" encoding="utf-8" ?> | |
<jstranslator> | |
<my-unique-id translate="message" module="namespace_module"> | |
<message>My Text to translate</message> | |
</my-unique-id> | |
<another-unique-id translate="message" module="namespace_module"> | |
<message>Another Text to translate</message> | |
</another-unique-id> | |
</jstranslator> |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2. in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** app/local/fr_FR/Namespace_Module.csv **/ | |
"My Text to translate","Mon texte à traduire" | |
"Another Text to translate","Un autre texte à traduire" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment