Drupal language navigation - php

I want to show the language navigation icon on the header of my side. I use locale, i18 and content type translation. I am not interested to use module for language icon, I just want the link of the corresponding node and available languages. How can I achieve this? I am using Drupal 6

If you use the module for the language icons, you will notice that when you are in a certain node, and you press on a different language, you will jump to the same node but in the other language.
In other words, you should change the language switcher from flags to whatever you want..

Related

Language switcher does not show flags or languages

I am trying to show the Language switcher. i had created Language switcher in back end and assign to position-7 there is visual the title of Language switcher and also drop-down but there are no any language in drop-down and not a flags.

How to load a different header.php depending on Multilanguage plugin's selected language?

I am currently testing my WordPress site on localhost. I have managed to use Multilanguage plugin to change all of pages' content. But since my main content is in the editor and my menu is in header.php I am unable to do the same for my menu. Which raises a question - how to load a different header.php, translated to another language, depending on the selected language? Or is it better to have my menu included in the editor as well, so I can change it the same way I change my main content? Wouldn't that be inefficient since all of my pages use the same header?
Any help would be appreciated.
I'm not very familiar with Multilanguage by BestWebSoft plugin, you must check the documentation for some plugin-released method for changing your header. But if you want to do this switch manualy, you can do something like this:
Because get_header() can load diferent header templates, you can create several header files, named header.php, header-fr.php, header-de.php etc. In these files you can do what you want for current language. Then you must load proper header:
//get gurrent language
global $mltlngg_current_language; //this contains current locale in format 'en_EN' ...
get_header(explode('_', $mltlngg_current_language)[0]);
So if your current lang is fr_FR, get_header('fr') will search for header-fr.php file, and if missing, will load default header.php file.
Of course, if the difference between header files is only language specific, you can use WP built-in functions for translation L10n functions. and create your own translation.
Again, this is manual way to do this job, maybe your plugin can provide better way to do this :)
P.S: You can search plugin documentation to find better way to grab current language locale.

Qtranslate X: Show selector only if you have translated content

I don't want to use the normal Lang switcher, I just want to let the user know if that content is available in other languages.
Example: You are reading a page in English, and at the end of the article, something like: This article is also available in German and French.
I tried this one but didn't work - Wordpress - Qtranslate to show only available languages
Any ideas?
Thanks!

Wordpress theme with second language

I didn't find any learn for Multi-Lingual !
1.How to use function _e() ?
2.What's text_domain ? How can i set text_domain ?
e.g:
_e('Mine','text_domain')
in english returns "Mine"
in example language is "imja"
How to set "imja" ?
text_domain is a distinction inside WordPress that allows you to see which plugin or theme text comes from. The text domain can be any string that you want but as a best practice it should be a machine name of the theme or plugin you are building.
So if I had a plugin named MyPlugin I would translate text using any of the WordPress translation functions like:
print __("Translateable Text", "MyPlugin");
_e("Text that is translated then echoed", "MyPlugin");
For WordPress to render these strings in another language, in WordPress 4.0 and above, you can change the language at Settings > General > Site Language and your site will show the text in that language if available.
You will need language files for the language that you wish to change to, and if a plugin or theme doesn't offer a translation for your chosen language it will be rendered in the default language.
There are many tools and plugins for editing the .po/.mo files that hold the translations in WordPress. Some of those can be found in the WordPress translation handbook.

How to make a wordpress theme that supports only 1 .po file to support 2

i am trying to make my website support 2 languages that users can switch between them, i bought a theme that has a language directory with .po files such as en_US.po fr_FR.po and more. i copied the english file and translated it into Arabic, in order to apply the Arabic translation i have to rename the ar_EG.po to en_US.po which leaves me with 1 language option and i need to have both Arabic and English. Is there a way that i can make my website switch between 2 .PO files instead of 1 or can i make a new folder inside my word press installation with the same website but with the other language file working and both of the websites linked to the same database?
There are various plugins to manage multilanguage sites; I would personally recommend Polylang since it's free, very easy to use and makes a smart use of WordPress APIs so it's developer friendly, if you would need that. Also, every content gets its own URL, which it's good for SEO.
After installation, go into Settings → Languages to define the languages of your site. The plugin provides a widget that will enable your visitors to change the language of the site, as well as an special nav menu item.
You should keep the theme translation as ar_EG.po; the plugin and language switcher that comes with it will take care of loading the appropiate language file for the theme.
ya elipelavinz is right that plugins name is polylnag
if you want to tranlate your theme caption use codingstyleloalization
codingstylelocalization translate only __() caption or _e() function

Categories