Re: Trouble switching locales with i18ntransformer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Cédric, On 1/9/18 2:39 PM, Cédric Damioli wrote: > Just in case, did you try to hardcode the "es" value : > > /> I just tried this, and it appears to work as expected: I get the strings being loaded from bundle_es.xml. That got me to reviewing a few things and I think this was a simple, boneheaded syntax error on my part: This: should have been this: Two changes: 1. Variable references do not have a $ prefix 2. Global variable references need the "global" After fixing those two issues, I'm getting the expected text in the expected language. Apologies for the noise, and thanks for the help! Thanks, - -chris > Le 09/01/2018 à 17:34, Christopher Schultz a écrit : All, > > I have an I18NTranformer configured and elements in my > stylesheets and everything is working for the default locale. But > changing locales doesn't seem to be working for me. I think I must > be missing something. > > I'm using Cocoon 2.1.11. > > Here's what I have: > > sitemap.xmap: > >...> location="/path/to/dir" /> location="/path/to/dir" /> ... > > > > en ... > > > ... > > ... > > > I have 3 files in /path/to/files: > > common.xml [xml:lang="en"] summary.xml[xml:lang="en"] > summary_es.xml [xml:lang="es"] > > This works as expected with en is set > in the global-variables section. > > I was expecting that changing to: > > es > > And then restarting Cocoon would end up using the text from my > summary_es.xml file, but it's still showing the English text from > summary.xml. > > Replacing summary.xml with summary_es.xml works of course (i.e. > the text from summary_es.xml is now showing in my rendered pages). > > The client (browser) is advertising a preference for lang=en, but > that shouldn't matter because I'm invoking the i18n transform > specifically with locale="en", right? I even changed by browser's > preferred language from English to Spanish and nothing changed. > > I'd prefer to be able to change the locale by setting the > global variable and not doing anything else. What am > I missing, here? > > -chris >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org >> For additional commands, e-mail: users-h...@cocoon.apache.org >> > -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpXlGIdHGNocmlzQGNo cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFiB0BAAkrdBkLQc4zy+D0Db dRDpB6Tt2umhRR5T6fidWhWsY661IEV9GNWl1WdbYGW2OuozVwik8nOJBsFvmbTa y+eejwWjzxRPqjwM+Lon9/6LVWgOWkHRTXrqwyxRD/6XfiXq73G5lc1e2xeFZICA c3hmgHS98Ett1iX+pmMR+EDlW73dRR7SPFDk477v69E5JG4tnUamArlzLBURl5yA OWkmY73wdLD2DQksb2ldHvTVM93b4K9PAz+7Y0Ch2zRBrIGzXsBzJ6YWHysEsdr0 IQNfUGwrj7BV8QmNwJx+rfSnJ5OSfaVM/+K3MAhyu8OPA1LouEos3L8D7KZnUpY5 mqN1/2XH8SotRsYrtnLF5dlongSGDtP+h/4PXyPevaBaPSQBlMLnET8COps3rR0E lo4w6++Wtguv03rgt8KTegGtPq+RKOwvS12DKjx8ZMeEJipOYe1P/BwP90Xeq6J9 4ZqAqRIdGJd5SfVZfmnO+5Xa0X2q3spayHpVMnR2qHXsUEltDqvXdzuXUU2xTtln FP6pC1c47lmWXSrwwZE8CXYfPpr2wvSdXFAlQ/a053kEi0QgPiO/pHU331cThBqE pmxKtaj1xX1jIbKWfBu/0Y5Mgg1AJPbD5SxAWYweWNQ59qsXl986xnzuF83cUQJA heZprqscW2yAz45/G8uRJkSwY6o= =NJLR -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Trouble switching locales with i18ntransformer
Hi Christopher, Just in case, did you try to hardcode the "es" value : Regards, Cédric Le 09/01/2018 à 17:34, Christopher Schultz a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, I have an I18NTranformer configured and elements in my stylesheets and everything is working for the default locale. But changing locales doesn't seem to be working for me. I think I must be missing something. I'm using Cocoon 2.1.11. Here's what I have: sitemap.xmap: ... en ... ... ... I have 3 files in /path/to/files: common.xml [xml:lang="en"] summary.xml[xml:lang="en"] summary_es.xml [xml:lang="es"] This works as expected with en is set in the global-variables section. I was expecting that changing to: es And then restarting Cocoon would end up using the text from my summary_es.xml file, but it's still showing the English text from summary.xml. Replacing summary.xml with summary_es.xml works of course (i.e. the text from summary_es.xml is now showing in my rendered pages). The client (browser) is advertising a preference for lang=en, but that shouldn't matter because I'm invoking the i18n transform specifically with locale="en", right? I even changed by browser's preferred language from English to Spanish and nothing changed. I'd prefer to be able to change the locale by setting the global variable and not doing anything else. What am I missing, here? - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpU7yMdHGNocmlzQGNo cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFiDLQ/6A0SqCs/ava78tK53 CSvMZqpY4xfKXu3GQqS+7DK0wxi4pOcnsNtRxhaQHmPVPvtPKv6H0+fzGIMkRpGn lJRcXzSFAa4zkWcQ2zDPh+FatROftroTRK+TljVIrmYJG4BNFbuH1PlNgpj3dPOC bpuKhTNAC8lz7Pdu9JbTiy3mCSXihv18S/wcJ52g69Uh8oa5Vo1o6nHDO1hEe1zt ejBDVQd5pytmFomWrYm2BR0/OG3mjUY+9uyI3Ys1K8uuFDFxtT6u0Ew0RtpYP9T3 UdWCvcR1ixmVNQ9Xwxtk8Cf0n0eoYdffdj+LK3h7WdCF/eJCkRkxTzrB2KmFnaiq BwHJmXs1u0V5If9POEBsP+GjhdwCtdV2up16yb6f2Mw6X0/fsQvmmVA9eQUk7/EH s94qvOkjeozTZVGd8Hovw9GXYze9MMHOp4lVz5H93e0Psjy8BBIOfSyxQEtPx9A9 xh/POW1BOKDUw1O2/x8f21yHwlOcwfIrkQKRvp9cAFQMWtAsJ7QJVqUX5jdtIsrO H/tBO0+qO7HNfxllyHeSVbx+nPkHEXceijUZfhG+Nakmi/GfgMgtangrKbfSflEU vl+qRHbHYdBphrIrWRy6huyOQojV4RAxp8WcV8+M9NrtItFIUeDuCnJumH51Fm1Y oubhYj1xaPRowGIlWmrAD3tlEIo= =NoLl -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org -- Cédric Damioli CMS - Java - Open Source www.ametys.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Trouble switching locales with i18ntransformer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 1/9/18 11:34 AM, Christopher Schultz wrote: > All, > > I have an I18NTranformer configured and elements in my > stylesheets and everything is working for the default locale. But > changing locales doesn't seem to be working for me. I think I must > be missing something. > > I'm using Cocoon 2.1.11. > > Here's what I have: > > sitemap.xmap: > >...> location="/path/to/dir" /> location="/path/to/dir" /> ... > > > > en ... > > > ... > > ... > > > I have 3 files in /path/to/files: > > common.xml [xml:lang="en"] summary.xml[xml:lang="en"] > summary_es.xml [xml:lang="es"] > > This works as expected with en is set > in the global-variables section. > > I was expecting that changing to: > > es > > And then restarting Cocoon would end up using the text from my > summary_es.xml file, but it's still showing the English text from > summary.xml. > > Replacing summary.xml with summary_es.xml works of course (i.e. > the text from summary_es.xml is now showing in my rendered pages). > > The client (browser) is advertising a preference for lang=en, but > that shouldn't matter because I'm invoking the i18n transform > specifically with locale="en", right? I even changed by browser's > preferred language from English to Spanish and nothing changed. > > I'd prefer to be able to change the locale by setting the > global variable and not doing anything else. What am > I missing, here? Another data point: I decided to remove the "default" locale, like this: $ cd /path/to/dir $ mv summary.xml summary_en.xml $ mv common.xml common_en.xml $ ls common_en.xml summary_en.xmlsummary_es.xml [i18n-locale in sitemap is still set to "es" (Spanish)] [bounce Cocoon, reload page] Now, the page shows "untranslated" (which is my value) for everything. So it seems that Cocoon is not picking-up my non-default localized files at all; it's only using [catalogue.xml] and not the locale-specific ones. Any suggestions? - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpU89UdHGNocmlzQGNo cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgyOA//cEGu5N7AudHdNSV9 L6pvhBRjoHcWtukUmnNqv7F57fztelEj7eI3WRNeBFbV8f5xS2sJZd/dJI28eGzR 6VHXJwHXQWv5RT4KKAEhw/esI2CduncwMrpf+ZZvD5YiA4qYT/Jqnte/ove4O/6s hbZJ6a+qvaedVVOMNVCUrrNcgslJHcMAXzzZYtDU9r4EMKgn7ZOWM1uFmBYliSlT k80KZS+0czjZ/0VzWGATAXX7z7lqAL5DLwX+A8aReCDl4rWAtR21Gl4nUKX2Gfc0 mwQX0SFp4Uh0vBtmjIUezK0S4adCFG/d5vzVCA5goHaJxkctNkqt6VEWuge2MbTK 0INeVpfql6g8bKA3kKxTIqioUwbbcPKxtv1RrjCUqTPSJqY/I6HHhDnNJHvodmmJ p+7pp0kLqoTwWC0uahuzqwN95HwHfnknjcCcTrmisJ3mK9hNV66owRVfyb9EI342 PGHCCimpTXfENGsw+biI+bpo08XQHEohiylSKfsnMRUYU75EhZjtedy0PXKpv6mF wWzmfCL2y1DKrZPUB7ukL7JZ7M5CqETa2x2adolwu/oT+xeDY5QfBzNFy144OsEP 0tLH9JpVuQWQH2Fk6+Dw/71Z4fQqiU6vP/L5bLc2qVmkgKl1udNPsJ/Ffb6nAZEU BsUkDSw/nRgRbDpBtc6T2Lo+VM0= =7YqD -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org