GetSimple Support Forum

Full Version: Support for multilanguage sites, Internationalization (I18N)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
intelx86 Wrote:Hello everybody.
I spotted that sitemap.xml contains malformed addresses like:

Code:
http://www.example.com/gs/%language%/subcat/simplepage/
http://www.example.com/gs/%language%/simplepage2_de/
http://www.example.com/gs/%language%/index_fr/
http://www.example.com/gs/

instead of
Code:
http://www.example.com/gs/en/subcat/simplepage/
http://www.example.com/gs/de/simplepage2/
http://www.example.com/gs/fr/
http://www.example.com/gs/en/

I think it's not possible to change how the sitemap is generated.
But if someone can find a way/patch, I'll include it in one of the next versions.
Suggestion for Edit Navigation Structure section: if you do some changes in the menus and then visit another page without saving changes, warn and let the user choose to stay or cancel changes (just like GS page editor does).
Superbobo Wrote:Hi,

I discover the beauty getsimple and one of the things is a simple implementation language version of the article as well as components, etc. Non English very well so I do not know if that's somewhere in this thread overlooked, but not how to resolve the translation page as well as a reference.

The SEO and search I find it better if I have contacts, such as pages for the English and Czech version of the url will look like this

www.site.com/cs/kontakt - for Czech or better yet just www.site.com/kontakt
www.site.com/en/contact - for English or better yet just www.site.com/contact

Please, is any solution? It is understood the query, I am weak in English Smile
Superbobo Wrote:
Superbobo Wrote:Hi,

I discover the beauty getsimple and one of the things is a simple implementation language version of the article as well as components, etc. Non English very well so I do not know if that's somewhere in this thread overlooked, but not how to resolve the translation page as well as a reference.

The SEO and search I find it better if I have contacts, such as pages for the English and Czech version of the url will look like this

www.site.com/cs/kontakt - for Czech or better yet just www.site.com/kontakt
www.site.com/en/contact - for English or better yet just www.site.com/contact

Please, is any solution? It is understood the query, I am weak in English Smile

This is currently not possible - all languages need to have the same slug name.
Thanks for the answer even if it is not what I wanted to hear Smile
I was searching for the possibilities to customize the error 404 page. Have found How to change 404 error message (lang) and have added that info to /wiki/404

Then I have found a discussion of (i think) Pre 3.0 time: 404 Page Translation : Dev Questions & Vote. Quotes from there:
mvlcek 2011-03-13 19:39:02 Wrote:Just check if there is a page with slug name 404 (404.xml) and display it, if it exists.
This way on multilanguage sites (I18N plugin), users can create pages 404_de, 404_it, etc. to present the error in the correct language.
mvlcek 2011-04-08 21:57:11 Wrote:
krisu Wrote:My suggestion is that translators should able translate the 404 with translation file, but user can have control over it if he wants way that mvlcek suggested.
Yes that's best: If there is a page 404.xml, display it (like a normal page is displayed, i.e. with hooks), otherwise display the default title/message, which should be read from the language files instead of being hardcoded.

By displaying the 404-page with all hooks, the correct language page can be displayed (with the I18N plugin) and one can even create a page that would display the search results from searching with the URL...

I use GS 3.1 and I18N 2.6 with (de) as standard and (en) and (it) as secondary languages. I have enabled FancyURLs with "%language%/%parent%/%slug%/". I haven't found better informations of how 404 probably works actually on a installation like this.
I have created 404 page in german and 404_en and 404_it pages. Now when I try to view a non existing URL on the GS-Installation (exampe: domain.com/xyz) I receive with every browser language (de, en, it) every time only the (de) 404 page. Also domain.com/en/xyz did not change everything.

Can somebody help me in this, is it the .htaccess RewriteEngine ?
Code:
# RewriteRule ^/?$ de/ [R,L]   # redirect to language of your choice. Quote out if undesired.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de|it)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de|it)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
ChriS Wrote:I was searching for the possibilities to customize the error 404 page. Have found How to change 404 error message (lang) and have added that info to /wiki/404

Currently I18N does not choose the correct language for the 404 page. It will be corrected in the next version.
Thanks for the response mvlcek.

I'm using I18N 2.6 in GS 3.1 with "Include Language in URL" ("%language%/%parent%/%slug%")
mvlcek Wrote:
intelx86 Wrote:... I spotted that sitemap.xml contains malformed addresses like:
Code:
http://www.example.com/gs/%language%/subcat/simplepage/...
I think it's not possible to change how the sitemap is generated.
But if someone can find a way/patch, I'll include it in one of the next versions.
Having the same configuration/situation I feel a little uncomfortable knowing that the bots get to see this unusable file.

Additionally the functionality of the WYSIWYG-Editor-function "insert/edit link" seems unusable for "Link to local page":
  • In "Select page" the site structure is showed in a confusing alphabetical order of all pages in all languages (in my case 3)
  • Using the function to link on the english contact page the language variable is also not inserted correctly. Example: <a href="/%language%/contact_en/">Contact</a> instead of <a href="/en/contact/">Contact</a>
I can explain to possible editors to not use this function (and just copy the URL of the desired page), but this is suboptimal. I have to search if this WYSIWYG-function can be disabled as a hotfix and hope that in future versions there will be a solution.
@ChriS:

Patch to remove "Link to local page" from the dropdown menu:
http://get-simple.info/forum/post/21528/#p21528
Posting here as well, because I'm getting a little desperate.


mvlcek Wrote:
lrsk Wrote:I am having some trouble adding I18N functionality to another plugin I'm using (user-login). I have previously hard-coded messages to the user etc, but would now like to add a language switching capability.

I decided to use I18N for this, and I followed the instructions here to be able to call e.g. i18n_r("user-login/REGISTER_MSG"). This works to a degree, but I am not able to switch between languages.

At first, everything was always English, confirmed by dumping $LANG to the screen. Then I decided to add $LANG = "nb_NO"; To my gsconfig.php file. This made everything Norwegian. The user-login plugin is using the language files I made in user-login/lang/ but I don't understand how to make the ?setlang=en/nb work with it.

Thanks for a great plugin. Hoping for a quick resolution.

The Front End User Plugin does not support the I18N plugin but relies on the $LANG variable.
Depending on how the Front End User Plugin works internally, you might have success with adding the following somewhere to the top of your template:
Code:
<?php global $language; $LANG = $language == 'nb' ? 'nb_NO' : 'en_US'; ?>
(of course this will not work, if the plugin loads the language texts before the template is executed)


I have tried adding this code in the header.php file that I use for the template, but the setlang functionality is still not working right with the user-login plugin. I have tried adding the code:

Code:
if (function_exists('i18n_load_texts')) {
    i18n_load_texts('user-login');
  } else {  
    i18n_merge('user-login', substr($LANG,0,2)) || i18n_merge('user-login', 'en');
  }

into the plugin file, but it still won't work correctly. In fact, it does work if I set the language using setlang and then navigate to a different page or refresh the login page. I have dug deeper into the code and found that $LANG does not change until after I navigate to a different page or rerun the same page, nor does $_SESSION['language']. I thought about setting $LANG = $language in the i18n_load_texts() function or something, but the $language variable is empty there for some reason.

I don't want to create a solution that is so hacky that I can't maintain the site...
lrsk Wrote:
Code:
if (function_exists('i18n_load_texts')) {
    i18n_load_texts('user-login');
  } else {  
    i18n_merge('user-login', substr($LANG,0,2)) || i18n_merge('user-login', 'en');
  }

into the plugin file, but it still won't work correctly. In fact, it does work if I set the language using setlang and then navigate to a different page or refresh the login page. I have dug deeper into the code and found that $LANG does not change until after I navigate to a different page or rerun the same page, nor does $_SESSION['language']. I thought about setting $LANG = $language in the i18n_load_texts() function or something, but the $language variable is empty there for some reason.

I don't want to create a solution that is so hacky that I can't maintain the site...

Where have you added this code?
Looking at the plugin, it should be at the top of the function show_login_box(), welcome_message_login(), etc.
The order in which functionalities are executed:
  • plugins are loaded, language is not known, thus putting the code at the top of the plugin file won't work
  • on the index-pretemplate hook I18N determines the best language,
  • thus it is known at the beginning of the template
  • plugin functions like show_login_box are called, the language is known here, too

Hope this helps.
mvlcek Wrote:Where have you added this code?
Looking at the plugin, it should be at the top of the function show_login_box(), welcome_message_login(), etc.
The order in which functionalities are executed:
  • plugins are loaded, language is not known, thus putting the code at the top of the plugin file won't work
  • on the index-pretemplate hook I18N determines the best language,
  • thus it is known at the beginning of the template
  • plugin functions like show_login_box are called, the language is known here, too

Hope this helps.

Yeah this helped a lot actually. I have it working now. This plugin has some login logic in the function user_login_check(), and the language preference is not visible there. I have extended the code in this function to give user feedback upon invalid usernames etc so I was using the i18n_r() function there, but this was giving me problems. I just set code names for certain events in user_login_check(), and evaluated them in show_login_box().

Thanks so much for the help!
Hello everybody. I'm new to the forum but found Get-Simple and I18N plugin very interesting projects.
I've just translated i18n_base and i18n_navigation into italian... where can I upload or who can I send the language files ?
I've actually also translated "send anonymus data" that is provided with getsimple, and just now I'm translating "multi user" plugin, and I'd like to know how to contribute these language files to the community.
Bye!
alez Wrote:Hello everybody. I'm new to the forum but found Get-Simple and I18N plugin very interesting projects.
I've just translated i18n_base and i18n_navigation into italian... where can I upload or who can I send the language files ?
I've actually also translated "send anonymus data" that is provided with getsimple, and just now I'm translating "multi user" plugin, and I'd like to know how to contribute these language files to the community.
Bye!

Please upload them to Extend and post a short notice in the respective plugin's support topic. Most plugin authors will include it in their next release and in the mean time anybody can download it from Extend.
mvlcek Wrote:Please upload them to Extend and post a short notice in the respective plugin's support topic. Most plugin authors will include it in their next release and in the mean time anybody can download it from Extend.

Thank you for reply. Just done that.
I18N italian translation is available here http://get-simple.info/extend/plugin-lan...ation/407/
Hi Guys!
I am using GS for a few months, now I have another project and I went for GS again.
My problem is, when I use this plugin, page renders perfectly fine, but I cannot access the admin panel or when I am editing page, it doesn't save, deletes everything from the page, title is set to {No title} I believe and I can't even recover it from the backup, because it doesn't redirect me anywhere. Once I delete this plugin, everything is fine. I am sure that I used this plugin before on the same hosting and everything was just fine.
Did you do previously any updates? I was running 3.1, then I tried 3.0 if it isn't just compatibility question, but both with no luck. I would appreciate any help.

Thanks!
Matus
I've got a strange problem with I18N_SHOW_LANGUAGE.
Basically language elements of 1st level show as supposed.
But if parent item contains child slugs, they show up in menu only, when their parent is the page being currently visited. Otherwise only first level of menu items is rendered by the plugin.

I suppose it's more a bug, than a feature Wink


using: GS3.1, i18n 2.6, all other plugins turned off
yojoe Wrote:I've got a strange problem with I18N_SHOW_LANGUAGE.
Basically language elements of 1st level show as supposed.
But if parent item contains child slugs, they show up in menu only, when their parent is the page being currently visited. Otherwise only first level of menu items is rendered by the plugin.

I suppose it's more a bug, than a feature Wink

It's definitely not a bug, it's correctly described as working like I18N_SHOW_NORMAL.
There is currently no I18N_SHOW_LANGUAGE which works like I18N_SHOW_MENU showing all menu items.
Is it possible to do any of the filters to select from the directory by using Your plugin. Such as here or what?
mvlcek Wrote:It's definitely not a bug, it's correctly described as working like I18N_SHOW_NORMAL.
There is currently no I18N_SHOW_LANGUAGE which works like I18N_SHOW_MENU showing all menu items.

HA! I've read whole documentation dozen times, and since "I18N_SHOW_LANGUAGE: like I18N_SHOW_NORMAL, but only menu items are shown that exist in the current language." didn't mention that _LANGUAGE won't generate whole menu structure (parent => slug), there's no way I could guess it's not a bug. Neither is not a feature, as It seems like a lack of feature.
I still strive with laconic descriptions (or else, not many use case descriptions) of plugins you develop, and with some luck I'm able to achieve roughly the things I'd like.

To sum up things, either I'll go with half translated menu structure for all language versions, or end up with flat 1st lvl menu ?
yojoe Wrote:...
Neither is not a feature, as It seems like a lack of feature.
...

To sum up things, either I'll go with half translated menu structure for all language versions, or end up with flat 1st lvl menu ?

You are right, it's a lack of feature, due to incrementally adding features, whenever there is a need.

As to what you end up with: I suppose you are using pulldown menus, because if you have a one-level menu bar and a sidebar menu with the additional levels, the currently featured behaviour is normally exactly what you want - only the current menu is open.

I'll try to add the feature this weekend.
mvlcek Wrote:You are right, it's a lack of feature, due to incrementally adding features, whenever there is a need.
I would give my left nut that this functionality was in the core of plugin, after you merged navi and multilanguage plugins.


Quote:As to what you end up with: I suppose you are using pulldown menus, because if you have a one-level menu bar and a sidebar menu with the additional levels, the currently featured behaviour is normally exactly what you want - only the current menu is open.

I'll try to add the feature this weekend.
Yes, I'm trying to make a dropdown with multilanguage support for a new GS theme I'm developing, and I'd like to make it fully compatible with your most popular i18n plugins.
I never had a necessity to prepare a multilanguage dropdown menu for GS based website, until now.

I'm even curious how many GS based multilanguage websites are out there.
I18N version 3.0:
  • new flags for better control on how the navigation is generated (@yojoe)
  • custom navigation rendering, e.g. if you want to add an icon or CSS classes, etc., see here for more information (@Dominic)
  • site map generation (see below)

The new flags (use them instead of I18N_SHOW_NORMAL, etc.) are (see also here:
  • I18N_FILTER_NONE - no filter (private pages are always filtered)
  • I18N_FILTER_CURRENT - show children of given page and all siblings and parents with siblings
  • I18N_FILTER_LANGUAGE - show only pages in current language
  • I18N_FILTER_MENU - show only menu pages
  • I18N_OUTPUT_MENU - output menu title
  • I18N_OUTPUT_TITLE - output page title
Combine them with |, e.g. instead of I18N_SHOW_NORMAL you can use I18N_FILTER_MENU | I18N_FILTER_CURRENT | I18N_OUTPUT_MENU.

I18N will try to create correct sitemaps depending on your fancy URL settings, however, there are the following limitations for GetSimple 3.1:
  • sitemap generation, when saving pages: OK
  • sitemap generation, when deleting pages: GetSimple generates a (wrong) sitemap, immediately followed by I18N generating the correct one.
  • sitemap generation, when changing settings: GetSimple generates a (wrong) sitemap, followed by I18N generating the correct one.
  • sitemap generation, when restoring a backed up page: I18N CAN NOT GENERATE a sitemap, you have to use the "Generate Sitemap" (added by I18N) sidebar menu in the themes tab.
Leo-777 Wrote:Is it possible to do any of the filters to select from the directory by using Your plugin. Such as here or what?

Normally you would rather use the I18N Search plugin filtering for the keywords of your pages.

You can also show filtered menus as detailed here.
Hello!

I found a bug (use GS3.1) in the plugin i18n (v3.0): when generate sitemap.xml modification date of all files stay in 1970. It looks like this:

Code:
<lastmod>1970-01-01T02:00:00+00:00</lastmod>

To test this, in tab "Plugins" deactivate I18N Base - sitemap.xml is generated with the correct date of the modification of files.

In addition to this, I noticed another small inaccuracy. By default, the tab "Theme" when off the plugin I18N Base present button View Sitemap, which uses the function
Code:
http://somadomain.com/admin/sitemap.php
If the plugin I18N Base activated - reassigned to the original button and there is another: Generate Sitemap. Now both of these buttons work equally: they involve the function
Code:
http://somadomain.com/admin/load.php?Id=i18n_base&sitemap

Do you plan in the near future to solve this problem?
Thank you in advance.

PS: Sorry for my bad English.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43