I have been really hard time to get my site translated.
I have MO and PO files, but my theme is not compatible with WPML and the developer team doesn’t to change it.
Therefore I may have to build a plugin or compatibility coding by myself. But I can’t really find how to do and what I need to do.
Does anybody know how to do? Or any tutorial for it? I can’t really find WMPL site as well.
You donât have to make anything special for WPML, using the regular translation code should be enough. See I18n for WordPress Developers in the Codex.
Code preparation
style.css
Add
Text Domain
andDomain Path
to your themeâsstyle.css
.Example:
Templates
Find all strings that should be translated and use the
Text Domain
value with the proper translation functions.Example:
Replace â¦
⦠with â¦
See
wp-includes/l10n.php
for available functions, and follwing the links in the Codex article mentioned earlier.Theme directory
Create a directory for translation files from the value of
Domain Path
.Example:
Now WPML should be able to find all strings for translation and to create the proper language files.
Finally, make sure the language file is actually loaded. Add the following code to the
functions.php
in you theme:WPML has a pretty good documentation on how to make a theme compatible.
Most of the time, all themes should work out of the box with WPML if the theme designer did follow the wp standards for internationalization.
If you don’t get further with that link and have any concrete problem we can help you with, please add the details of what goes wrong and how you tried to fix it to your question.