Support for multilanguage sites, Internationalization (I18N) - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: Support for multilanguage sites, Internationalization (I18N) (/showthread.php?tid=1221) |
Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-09 Yesterday I installed GetSimple and didn't find support for multilanguage sites. So I've created a plugin http://get-simple.info/extend/plugin/i18n/69/, which adds multilanguage support and hierarchical menus to your website. The language is determined by the language in the user session (if previously set with the URL parameter "setlang") and the http accept language header. By using the URL parameter "lang" this can be overridden for the current request. If you want to show the language in the URL, see here. Installation Copy i18n.php to your plugin directory, change the constant I18N_DEFAULT_LANGUAGE in i18n.php, and replace the following functions in your template(s):
Usage To internationalize a page,
The base page (without language) is assumed to be in the language specified as I18N_DEFAULT_LANGUAGE in i18n.php. To use the internationalized hierarchical menu,
get_i18n_navigation adds the following css classes to the list items:
If you want a one-level menu only, you have to make sure that all your base pages that are in the menu have "--- None ---" as parent. Problem Solving
If, when visiting the site (with Chrome), the languages switches back to the default language, after you have switched to another language (with parameter setlang=...)
Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-09 A new version (0.7) is available, which adds an I18N view on the admin pages tab, which shows all pages and their language variants in a table. Installation (additional) To make best use of the add links on the I18N view (some fields prefilled), you must patch the file admin/edit.php as follows: Code: ... Support for multilanguage sites, Internationalization (I18N) - marrco - 2011-01-10 looks really interesting. Will test this soon Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-18 A new version (0.8) is available, which simplifies the selection of a parent page and the position in the menu and allows any number of levels in your page structure. A demonstration and screen shots can be found on http://mvlcek.bplaced.net. Installation (changes) Just unzip the plugin zip into your plugins directory. The file admin/edit.php does NOT need to be changed any more! Support for multilanguage sites, Internationalization (I18N) - ditlev - 2011-01-18 Works like a charm! Thank you very much for this nice plugin! Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2011-01-19 Yes, the plugin useful and works well Support for multilanguage sites, Internationalization (I18N) - marrco - 2011-01-19 does it cache the menu structure ? Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2011-01-19 how to switch languages and components for the language to do? Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-19 marrco Wrote:does it cache the menu structure ? Yes, it does. Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-19 Oleg06 Wrote:how to switch languages and components for the language to do? Not sure, if I understand your question correctly: The language is automatically switched based on the user's language preferences in the browser. If the site is e.g. english (default) and german and the user's prefered languages are italian and german, he will see the german page, if they are italian and spanish, he will see the default language (english). You can also switch languages for the next request or for the current session, see http://mvlcek.bplaced.net/get-simple/i18n/ at the bottom of the page. Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2011-01-19 I created a pages index_de and index_ru, written links and and but somehow it does not work teach me please :-) Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-19 Your language links use neowebtime instead of neowebtime.ru Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2011-01-19 thanks, works Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2011-01-19 þхрõýõть, plugin is excellent, wonderful Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-01-23 I have uploaded a new version, which also has functions to display breadcrumbs. See http://mvlcek.bplaced.net/multi-level-navigation/breadcrumbs/ for a demo and details. Support for multilanguage sites, Internationalization (I18N) - iggy - 2011-02-08 Hi! Thanks for plugin. I have a question... How can I call language name from a template? I need to add something to a template when specific language is active. Sorry, I don't know php Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-02-08 iggy Wrote:Hi! There is a global variable $language set, if the current language is not the default language, thus use for a non-default language 'de': Code: <?php if (isset($language) && $language == 'de') { ?> and for the default language: Code: <?php if (!isset($language)) { ?> Support for multilanguage sites, Internationalization (I18N) - ldac - 2011-03-01 This isn't a bug but It should be improved: When you try to name a new page with a "_" (e.g. index_en) it automatically hides the "Template" options. This can be a problem, for example I wanted to use a different template for the main page and its English version but I couldn't because of this. Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-03-01 ldac Wrote:This isn't a bug but It should be improved: When you try to name a new page with a "_" (e.g. index_en) it automatically hides the "Template" options. This can be a problem, for example I wanted to use a different template for the main page and its English version but I couldn't because of this. Currently it is not possible to use different templates for languages with the I18N plugin, which is the reason, why the option is hidden. As the default language is used when a translation is not available, the different templates shouldn't have many differences in any case, lest the user be baffled by the layout changing between pages. Why do you want to have a different template? If it's just for small differences, you can include conditionals like Code: <?php if ($language == 'de') { ?>...<?php } ?> in your template. Support for multilanguage sites, Internationalization (I18N) - Texta - 2011-03-02 Hello, thanks mvlcek for this plugin! But it doesn't seem to work with the new beta "GetSimple_3.0Beta_r323". Btw thats the only beta version I tried it with. The problem is, I can't create a page called something_en, because the slug/URL with somehow "loose" the underscore after clicking on save. Support for multilanguage sites, Internationalization (I18N) - ultrastudio - 2011-03-02 I've high problem with the installation of this plugin. I use Get Simple 2.0.1 and I18N Plugin 0.9.1, but in administration page the file editextras.php stop his code print to the first line of XML section. The result is that the plugin is totally unusable because whene I would to create a new page I can see only the title input and the link "Options", but I can't see all the form. Where is the problem? Support for multilanguage sites, Internationalization (I18N) - ultrastudio - 2011-03-02 ultrastudio Wrote:I've high problem with the installation of this plugin. I've resolve: sorry all, the solution was update core to the new stable version of GetSimple. Well, this plugin is actually compatible with GetSimple 2.03.1 and not with GetSimple 2.01. Support for multilanguage sites, Internationalization (I18N) - Texta - 2011-03-02 Texta Wrote:But it doesn't seem to work with the new beta "GetSimple_3.0Beta_r323".Oh, just found in the changelog for GS 3: Quote:Conversion of all i18n calls to a new functionWhat does that mean? And how do I use it now? Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2011-03-02 Texta Wrote:Oh, just found in the changelog for GS 3: I think this is only how translations for the admin part are handled. It has nothing to do with the I18N plugin (which provides multiple languages for the public part). Support for multilanguage sites, Internationalization (I18N) - ccagle8 - 2011-03-02 mvlcek Wrote:I think this is only how translations for the admin part are handled.correct assumption. |