Closed ctjhoa closed 4 years ago
Hi,
I not 100% sure to fully understand ember l10n:sync command, so let me explain what I've try.
ember l10n:sync
Using a new ember app:
ember-source
~3.15.0
ember-l10n
^4.3.1
Here is my template
template/application.hbs:
{{!-- The following component displays Ember's default welcome message. --}} {{!-- Feel free to remove this! --}} {{t "simple text"}} {{outlet}}
I generate po files using ember l10n:extract
ember l10n:extract
translations/en.po:
msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: app/templates/application.hbs:4:0 msgid "simple text" msgstr "simple text"
I change msgid "simple text" to msgid "some text" in translations/en.po
msgid "simple text"
msgid "some text"
translations/en.po
I expect ember l10n:sync to modify my template/application.hbs to
template/application.hbs
{{t "some text"}}
However it does nothing
% ember l10n:sync ======================================== PARSING SOURCE FILES ======================================== Checked ./app/app.js... unchanged ✔ Checked ./app/controllers/application.js... unchanged ✔ Checked ./app/router.js... unchanged ✔ Checked ./app/services/l10n.js... unchanged ✔ Checked ./app/templates/application.hbs... unchanged ✔ No files updated ✔ FINISHED ✔
Is it expected?
You need to leave the msgid and change the msgstr. Then, it should update your source files, replacing all occurrences of the msgid with the new msgstr.
msgid
msgstr
Hi,
I not 100% sure to fully understand
ember l10n:sync
command, so let me explain what I've try.Using a new ember app:
ember-source
:~3.15.0
ember-l10n
:^4.3.1
Here is my template
template/application.hbs:
I generate po files using
ember l10n:extract
translations/en.po:
I change
msgid "simple text"
tomsgid "some text"
intranslations/en.po
I expect
ember l10n:sync
to modify mytemplate/application.hbs
toHowever it does nothing
Is it expected?