I am using Drupal 8 for my project. Although it supports multiple languages, content editing is done in English, What if I change the language to french and then edit some content in English, will it automatically convert the edited content in french?
When you open node editing page like this:
en/node/251/edit
This means that you are editing English version of node with id 251. And if you open:
de/node/251/edit
you will be editing German version of the same node. So that language prefix is deterring what language version are you editing.
Drupal interface is also respecting that language prefix so if you are editing German version of content interface will also be on German.
So if node is multilingual (it's enabled in content type settings) and you change that "en" to "de" you will be editing the German translation for the same node and Drupal's interface will also switch from English to German.
Related
I need to add "ru" content localization. So I changed the following fragment:
<localizations>
<localization language="ru" default="true"/>
</localizations>
Then I ran the following command:
php bin/adminconsole sulu:document:initialize
After that, I replaced all the values of a "lang" attributes from "en" to "ru" in all xml-files inside config/templates/pages directory.
But all pages in the administration interface now have empty labels.
I tried changing the value of the "System Language" field in the permissions tab of the contacts to "English". I also reverted all xml-files inside config/templates/pages directory (from "ru" to "en"). Thus the fields become displayed.
So how can I add Russian localization in the "System language" field to solve my problem?
Sulu Core Developer here 🙂
What you have added is another content language, which describes in which languages the page, media, articles and so on can be translated. These languages also appear in the dropdown on the very right of the top toolbar.
However, this language only is about the values the content manager is filling into the fields. All the labels, navigation items and other texts that appear in the UI are displayed based on the system language of the user. Each user can choose their system language in the profile overlay, which will be shown when the name of the user is clicked on the left navigation.
So in order to see the ru titles you have added to the page XML files, the user needs to choose ru as language.
Unfortunately this language does not exist by default in Sulu. So what you can do is to add this language using the configuration in config/packages/sulu_admin.yaml.
sulu_core:
locales:
en: English
de: Deutsch
ru: Russian
translations:
- en
- de
- ru
Afterwards you can download a language using the sulu:admin:download-language command:
bin/console sulu:admin:download-language ru
This will try to download the russian language from our Crowdin Project, which is a crowdsourced translation platform. But I am sorry to say, that the russian translation does not exist there yet. If you want to contribute it, let us know, and we will create the russian language, so that you can start translating it.
If you really just want to add russian titles to the labels, you can still write the YAML configuration as above, and you will see them, when the user chose russian as their system language. All the other texts will fallback to english in that case.
i translated a wordpress site into simplified chinese, spanish, korean and deutsch with the help of WPML and .po/.mo files on wp-content/languages
All the languages editing went well, and i'm now finalizing the site. I need to translate three last strings. All is working on all languages, except simplified chinese (zh-hans):
I add the three new entries, i generate the .mo file with poedit, and nothing changes. The already translated string stays, and the news doesn't appears.
For testing, i removed the .mo file of simplified chinese, the site remains translated without changes. I'm stuck on it, are the translated strings in the database ? Is there .mo file caching from wordpress ?
Figured out the issue, WPML switched the locale from zh-hans to zh-cn without asking, regenerating .po and .mo.
Using a versioning system, i didn't saw the new files as they were generated by Wordpress.
Hope it helps
Ok, so I feel like a complete idiot asking this, but I've been looking around and I haven't found a decent answer.
I am using qTranslate as i18n plugin to create a multilingual website.
I have a localized framework/theme with a default.po file. I have built both en_CA.po/.mo and fr_FR.po/.mo files.
What do I do with these and how do I activate them?????
I have tried defining WPLANG in wp-config.php, with no result...
English is already the default one so it works fine, but the French one doesn't apply when switching form english to french... I still get the english text for theme strings (content translates fine)
Thanks for your help!
I figured out it appeared to be a setting in qTranslate that set both locales to en_US and fr_FR instead of en_CA and fr_CA
Thanks.
I have a big problem with the language switcher,
I have a multi language site that has every article in english and spanish , spanish being the default
so if one article is named :
domain.com/mi-articulo then the english one will be domain.com/en/my-article (using autopath is creating these aliases)
now this works fine if I manualy change the url.. but if I use the language switcher ..the english corespondent it's switches without aliases and Lang prefix
so instead of domain.com/en/my-article it finds domain.com/node/47 so as I have the menu and other things translated it makes drupal unaware of the language switched..
here are the screenshots to better understand what's happening (wierd behaviour)
ver1. spanish
ver2. english
now if i click on english ..look what happends (see url and content like drupal is not aware that this content is nor spanish nor english...because the language switcher doesn't find the aliases)
I had the same problem until I set the default 'Language domain'
in admin/settings/language/edit/en. Now the module is working as expected.
I stumbled upon the same issue today.
All nodes had been imported from another site. All translations were imported, but not the relationship between them, so if you edit a node and check the translations, you may notice that your node doesn't have any given translation.
If this is your issue, you may use the functionality to add existing nodes as translations.
I have the same problem with the language switcher; just cannot get it to do what it's supposed to do. I ended up effectively writing a very simple version of it by adding a block and inserting the following html:
<ul>
<li class="first en">English</li>
<li class="last fr">Français</li>
</ul>
It is limited in that it always takes you back to the homepage after a switch but once that's done, links to other nodes continue correctly with /fr in the url.
WordPress is so powerful.. but yet it is so weak with RTL Languages like Arabic and Hebrew...
I need to have the Front-End in Arabic and Admin area to stay in English and of course LTR..
If I use the Arabic version of WordPress. Everything including the admin area will be in Arabic and RTL. which will not be suitable at all.
In the same time. Visually editing an Arabic post should be in RTL while the HTML view should be LTR..
I can see that MU version on wordpress.com can have admin area in English while the frontend is in Arabic.
How to do that?
WordPress's back end can handle Arabic just fine, with both the editor and the database itself. If you want the front end to display in Arabic you'll need to use/develop a theme that uses Arabic.
If your blog is Arabic-only, you can add a CSS class to the div surrounding the post in the blog template file that sets the text-direction to ltr. If you use Arabic and English, you can set an if statement to decide what direction each post needs to be based on a custom field you add to the post from the back end.
The general steps to add RTL are:
Step 1 - Create the RTL CSS for Your Theme.
The first step is to create the CSS for displaying RTL languages correctly on your website. There are two methods for doing this. The first is to simply feed your existing stylesheet into a CSS RTL generator. This tool will examine your CSS and attempt to make a copy, but switching all the left and right alignments. This effectively creates a mirrored version of your website.
Step 2 - Ensure WordPress ‘Sees’ the RTL Styles.
If you’re using a CSS generator tool, you’ll now need to enqueue your new style-rtl.css stylesheet so WordPress can load it in at the appropriate time. This is just a matter of adding a snippet to your theme’s functions.php file.
Step 3: Test Your RTL Styles in WordPress RTL Tester plugin.
You have a few options for testing out RTL languages in your WordPress installation. The first is to simply switch WordPress to an RTL language. To do this, go to the Settings > General page in your WordPress dashboard. Then, select the first script language you see in the Language drop-down box
Here is a full guide: https://torquemag.io/2018/03/rtl-support-wordpress/
For a successfully RTL site example, check out this one.
If you have access to the file system where the site is hosted:
Go to ./wp-content/themes/{THEME_NAME}/.
Find the CSS files of both LTR and RTL (They may be named as "style.css" & "style-rtl.css", depending on the theme and if it supports RTL).
Rename them by switching their names.
This way RTL is only applied to the theme.
I had the same issue. The blog is in Arabic, and the admin back-end is in English.
If you are using Firefox, you can simply overcome this problem by clicking Switch Text Direction from the right-click menu on the TinyMCE.