Another question. On hidden link I want the fieldname, for example Afmetingen (I translated this yet with string translations to Dimensions), printed automaticaly. Now I have this in my archive.php:
Afmetingen <?php echo(types_render_field("afmetingen", array("arg1"=>"val1","arg2"=>"val2"))); ?>
In the cpt I filled in: 80 x 60cm
This prints out Afmetingen 80 x 60cm
This is ok, but I have 2 languages so I want this automaticaly.
what code can I use for it? Or are there more code examples than https://toolset.com/documentation/functions/ wher I can find out myself?
Dear Dido,
I assume you are using WPML, you need to wrap texts in gettext calls for the string translator to pick it up.
<?php _e('Afmetingen', 'goesart'); ?>
The second parameter, goesart, is useful for finding these strings in the string translator.
Please let me know if there is anything else that I can assist you with.
Regards.
Caridad
Sorry, buthis doesn't work. I looked at WPML FAQ and found out this example:
<?php _e('Afmetingen','theme-text-domain') ?>
A text-domain tells GetText (and WPML) what the text belongs to. It’s a string that doesn’t mean anything, except to you. You can choose any string that you like, but you should be consistent. The text-domain value will group related strings together.
Obviously, ‘theme-text-domain’ is not a good and unique name. For instance, if you’ve called your theme ‘star-geeks’, that would be a better value for the text-domain.
Well, the name of my theme is liquorice.
but this is not working either:
<?php _e('Afmetingen ', 'liquorice'); ?>
I moved the website to hidden link
I have found the solution, some properties on the WPML admin where not set right. I was using translation via MO-files. When I disabled this and let WPML do the translation, all was solved. Of course the MO-files should have worked too, but apparently they could not be found.