Reputation: 314
I am trying to set up the i18n behavior on Symfony 1.4.18. I have some i18n-friendly strings (using the two underscores) in my frontend layout. I tried to run the command below :
$ ./symfony i18n:extract frontend fr --auto-save
At first, symfony found 17 strings, but didn't build the path apps/frontend/i18n/fr/ nor the file inside : messages.xml.
I re-ran the command above, but this time Symfony did not find any string. I thought, if Symfony does not find new strings, it might save it somewhere, so I ran another command on my Linux, to find any occurrences on one of my i18n strings (Typically I have this string : ) :
$ grep "Freelance" $(find ./)
This command was launched at the root of my project, but unfortunately it didn't find any occurrences except the one in my layout.
I don't know what to do anymore to solve my problem.
PS : I hope my english isn't too bad, it's not my native language, but I try to do my best.
Upvotes: 0
Views: 1566
Reputation: 95
Do this in your project root:
sudo find . -print | grep -i 'messages.xml'
Then delete the file (s) you found (probably within sfDoctrinePlugin/i18n in the symfony vendor files)
Use the settings from above for your factory.yml and settings.yml
Restart task:
php symfony i18n:extract frontend fr --auto-save
That's all. Now the messages.xml is generated. Missing folders are created.
(Revert the chmod changes you did before)
Upvotes: 0
Reputation: 31
Try to add
messageSource: '%SF_APP_DIR%/i18n'
option to your i18n factory configuration.
And look for your messages.xml
in app_dir/i18n/your_culture
. Old messages.xml
where at vendor/symfony/lib/plugins/sfdoctrineplugin/i18n
in my case
Upvotes: 3
Reputation: 1700
Try to set i18n source in factories.yml
Something like this:
i18n:
class: sfI18N
param:
source: XLIFF
debug: false
untranslated_prefix: "[T]"
untranslated_suffix: "[/T]"
cache:
class: sfFileCache
param:
automatic_cleaning_factor: 0
cache_dir: %SF_I18N_CACHE_DIR%
lifetime: 31556926
prefix: %SF_APP_DIR%/i18n
here you can find more information.
Upvotes: 0
Reputation: 1696
Your default language is fr
and you're trying to get the translations to fr
?
The xml files should have the source string (in french - your default language) and target string (in english or whatever).
Try ./symfony i18n:extract frontend en --auto-save
(or whatever language you want, other than french) and let us know if you'll get what you need.
Upvotes: -1