These two versions introduce better ways to save and organize translations in .mo/po files used by xili-language plugin in multilingual WordPress Website context.
- 1 How xili-language chooses translation according current language.
- 2 What's new with a local-xx_XX.mo file ? Merging sources and hierarchies
- 3 Screens and windows improvements overview
- 4 Style with flags
How xili-language chooses translation according current language.
xili-language uses localization features of WP using .mo files to change the language of terms in theme and navigation items. The translations must be saved inside xx_XX.mo files of each language (fr_FR.mo for french). No translation are saved in database, no new table. Core libraries provided in WP are used by the plugin.
xili-language plugin provides an automatic selection of language in theme according to the language of displayed post, series of posts, page or articles. If the post is in gaelic, the texts of the theme will be in gaelic if the author checks the post as gaelic. Prerequisite: the theme must contain the good .mo file for the target language.
Example of webpage with theme 2011
Here, the category News is displayed in french : "Actualités"
Terms (title, label, ...) attached inside theme's files (and translated via MO files) are marked as T - currently in php use functions like __( ) or _e ( ) - as __('Search','twentyten'); -
Terms coming from the site itself according content strategy (category name, description, date format, blogname, list of languages,... are tagged as L
The new version 2.6 of xili-language is compatible with previous language .mo files. (see mergin rules in paragraph below)....
What's new with a local-xx_XX.mo file ? Merging sources and hierarchies
The files in theme's language sub-folder
Previously saved in theme's language files (xx_XX.mo), local datas (taxonomies, bloginfos, locale dates,...) are now in files named local-xx_XX.mo. To prepare and build .mo files, xili-dictionary is recommended. But if you prefer a text-editor or a poEdit, you can prepare text files named local-xx_XX.po like local-fr_FR.po for french translations... (xili-dictionary can also create these text files... and a translator can update the text file of his mother language.
Merging translations and hierarchy
WordPress offers ways to successively use translation files with priorities. Priority is given to translation in local-xx_XX.mo file. It is used before this in theme xx_XX.mo file. So if for any reason, you don't want to modify the theme files, you set a translation to "local' and your latest translation will be displayed.
Screens and windows improvements overview
Category Edit screen
Remainder: in multilingual CMS website powered by WordPress and xili-language, there is only one taxonomy named category as in a localized website. Only Name and Description are translated and displayed in target language according the current language of the displayed post(s).
A new fieldset (1) named 'Translated in' is inserted at end of the Edit Category Screen:
2 - Here is possible to see that a french translation of Name of the category is available in current fr_FR.mo file built by xili-dictionary plugin.
3 - Idem here for Description of the category.
The link 'Edit translations' will open xili-dictionary msg list.
Msg Edit screen
In the dashboard metabox under the msg content, gathered infos show displaying improvements and a new space under list of msgstr (translations): 1 - the msgstr is quoted to see the space used (for example in french translation of am suffix for date or when a space is added at end...).
2 - if set to 'local', a term will be saved in local-xx_XX.mo file and not in theme file xx_XX.mo
3 - this msg was added in dictionary when theme named twenty eleven-xili was active.
4 - this msg was present in the current file fr_FR.mo.
Export MO file
1 - After clicking the Export mo file button, the metabox shows three columns:
2 - Choice of language (french here) of the exported mo file,
3 - If local is checked, only local translation will be saved in a local-fr_FR.mo (french),
4 - If the xili-dictionary contains translations of terms of multiple themes, you can check or uncheck to choose. (By default, the current theme is checked) - don't affect local msg...
Style with flags
It is not mandatory but since now, it is possible to add style (and flags) inside dashboard and settings screens of xili-language and xili-dictionary plugin.
Webmaster is free to activate this option and to choose flags with example of css (xl-style.css and xd-style.css) delivered inside a plugin sub-folder (xili-css).
In the expert tab, a new setting is available:
Look and limits
In Web, Language is often associated with a flag of a country. What happen for english with USA and UK and more... ? What happen for french with France, Belgium, Québec and lot other countries ?
As requested by some webmaster and author, using flags (and colors) in admin side can help to differentiate and navigate between translations.
dev.xiligroup team decides to choose the way of style of elements. Without modifying the plugin itself, it is possible to define the style files and where to keep (link) the flags...
Style files: name and locations
The style file is named xl-style.css (for xili-language) and xd-style.css (for xili-dictionary).
The default example is shipped inside sub-folder named xili-css inside xili plugin folder.
The plugin search the style inside the theme folder, not found: it search inside wp-content/plugins/xilidev-libraries/ sub-folder and by default inside xili-css subfolder of the plugin itself. The files inside the plugin must not be modified. The place is displayed above the check 'Activate xl-style.css'.
If you decide to share the flags for the theme and the dashboard:
Copy xili-css folder in your current theme folder and move the flags in your current theme /images sub-folder (as in twentyeleven-xili theme example).
current theme folder /xili-css/ current theme folder /images/flags/
plugins folder location
Another alternative place in the xilidev-libraries subfolder in plugins folder (wp-content/plugins/):
plugins folder /xilidev-libraries/xili-css/ plugins folder /xilidev-libraries/xili-css/flags
xili-language v. 2.6
- When creating a post translation, the page is automatically redirected to the post that must be translated.
- If the original post is assigned to categories, when creating the translation, these categories will be assigned by default to the translation.
- To help taxonomy terms translation (category) - name and description - links are availables in Category Edit screen - see details above
xili-dictionary v. 2.1
- When creating a msgstr translation, the page is automatically redirected to the msgstr that must be translated.
- It is again possible to erase the dictionary in one click. xili-language and WP only need MO files created by xili-dictionary.
- When importing website infos to populate dictionary, also import language names from language list.