jeff@exitshoes.com
Member
Posted 4 months ago #
I'm working on a Chinese translation for All-in-One Event Calendar, but it only picks up the locale from WPLANG when calling its own localizations. When using qtranslate, language switching works for the content of events but not for ai1ec buttons, labels, headings, etc. Those only change if WPLANG is changed in wp-config.php.
Could this be related to the way ai1ec calls, or doesn't call get_locale() in the controller class?
We haven't tested the plugin on qtranslate yet. If you come up with a solution, do let me know and I will add it to the plugin.
jeff@exitshoes.com
Member
Posted 4 months ago #
It looks like load_texdomain function in class-ai1ec-app-controller.php is basically correct, but it's not updating for the change in locale. Can you tell me where ai1ec initializes its locale, which php class file? I'm happy to look into it some more.
File: app/controller/class-ai1ec-app-controller.php
Lines: 199-205
The function is called by init hook.
jeff@exitshoes.com
Member
Posted 4 months ago #
Using qtranslate to switch languages to chinese, I can see that ai1ec picks up the language change and adds this script to each page:
/* <![CDATA[ */
var ai1ec_event = {"language":"zh"};
/* ]]> */
How is that ai1ec_event script variable value initialized?
(WPLANG is still set to ''), so I know it's not picking it up from there.