Tag Info

New answers tagged

3

A technique like this has one really big advantage, and one really big disadvantage. Advantage The good thing is, like you mentioned, that the owner can dynamically change the theme name, and therefor the source where the translations are pulled from. If you have a special use case, for example different versions of the translations, this could be really ...


3

Yes this is problematic as i18n tools that parse your theme to generate a *.pot file for translation can't understand this as they do not run PHP code but just search your code as text. Here is a blogpost detailing on why this may cause trouble: Bottom line: Inside all translation functions, no PHP variables are allowed in the strings, for any reason, ...


0

Ah ha! I found the answer, and it's a really weird one. It just so happens that the particular strings I was trying to translate were the labels of required form fields, and looked like this: <?php echo '<label>' . __( 'Email *', 'cdashmm' ) . '</label>' ?> If I move the asterisk outside the string, like this: <?php echo ...


0

Since Wordpress 4, I suggest you create a simple plugin and "only" load the needed text domain. All strings in your Theme folders or templates or everywhere will be translated. Example: <?php /* Plugin Name: UA Translation UA Tiny select Description: Translation for Theme templates outside the main text domain Version: 1.0 Author: Jonas Lundman Author ...



Top 50 recent answers are included