Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
#26
Is there a way to hide I18n menu button on page creation ?
I wanted to make use of its menu functionality, but there's no standalone plugin for it.
Neither I can't find out what to comment/delete in the code to hide its menu button.
Addons: getsimple theme, Online Visitors, Notepad
Reply
#27
Thanks, for the explanation of "I18N" (never heard of it before, so had to google it), but that doesn't explain, why this plugin doesn't (seem) to work with the new beta "GetSimple_3.0Beta_r323".

Anyone else tried it?

Works with newest GS 2!

edit: clarified
Reply
#28
mvlcek Wrote: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.

But what if a user wants to create a new page that has nothing to do with a translation? For exaple I want to create a page with the URL my_dog, I couldn't change the template because of the plugin.
GS fan
Reply
#29
ldac Wrote:But what if a user wants to create a new page that has nothing to do with a translation? For exaple I want to create a page with the URL my_dog, I couldn't change the template because of the plugin.

If you have switched on fancy urls, underscores won't work anyway (unless you change the rules). Instead use "my-dog".

I could have done the I18N plugin in another way, e.g. with an extra language selection field, but this would have other disadvantages (e.g. slower, because you can't get the language from the file name). Not being able to use underscores in the URL name is irrelevant for me (and hopefully for others, too).
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#30
Mvlcek: I don't know yet how exactly does your i18n plugin maintain page files, but if it isn't already working in this way, wouldn't it better to create translated files under different directories (like data/pages/translations), and rewrite the links to
website.tld/language/%parent%/%slug% ?
f.e. www.mysite.tld/en/page1 ?

btw. any response for this question http://get-simple.info/forum/post/9843/#p9843 ?
Addons: getsimple theme, Online Visitors, Notepad
Reply
#31
yojoe Wrote:Is there a way to hide I18n menu button on page creation ?

You can (in i18n.php) remove/comment out the line

Code:
add_action('pages-sidebar', 'createSideMenu', array($thisfile, 'I18N'));

Or you can just ignore the button - if you don't add a page with underscore + language, it will offer the same functionality as the "view all pages" item.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#32
yojoe Wrote:wouldn't it better to create translated files under different directories (like data/pages/translations), and rewrite the links to
website.tld/language/%parent%/%slug% ?
f.e. www.mysite.tld/en/page1 ?

Different directories: by just adding the underscore + language to the slug name, the standard page edit/save functionality can be used. You don't even need the I18N pages view, it just improves the usability. With different directories get-simple would have to be patched.

Language in URL: The concept is to always have the same URL independent of the language. The user then gets the translation based on his prefered language(s) in the browser.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#33
I've uploaded a new version.

The only real difference is that it supports custom properties in the page files (e.g. the values entered using the CustomFields plugin). Use get_custom_field($name) and return_custom_field($name) to get the values corresponding to the current language.
And you might want to use the improved I18N Custom Fields plugin (http://get-simple.info/extend/plugin/i18...ields/100/) - GUI to define the custom fields, supports check boxes and WYSIWYG text areas, and more efficient, when used with I18N.

Other than that I have been splitting the core I18N functionality and the navigation functionality in preparation for a new admin page to edit the navigation structure using drag and drop (currently GetSimple only supports one admin page per plugin). Therefore there are now two php-Files and GetSimple reports two plugins: I18N Base and I18N Navigation.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#34
Version 0.9.7:
  • allows you to switch the I18N pages view between hierarchical and sorted by title
  • automatically saves the view type so that you will see the same view again the next time
  • includes a filter field where you can type a part of a page name - all non-matching pages are hidden as you type
  • the filter field has the focus on page load - goto the I18N view and start typing - never before have you found your page faster
  • works in GetSimple 3.0b (although some fields on the edit page are not hidden any more for non-default languages)

Upgrade instructions

Remove i18n.php and the directory i18n from the plugins directory and then unzip the new version into the plugins directory.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#35
How do you update the plugin without breaking the site?

I probably did it wrong, but I just uploaded the new files via FTP to my server, and the site (both front and back end) left me with a blank page. It only returned to normal when I removed the new files. Is it incompatible with the older version?
Reply
#36
Angryboy Wrote:How do you update the plugin without breaking the site?

I probably did it wrong, but I just uploaded the new files via FTP to my server, and the site (both front and back end) left me with a blank page. It only returned to normal when I removed the new files. Is it incompatible with the older version?

It should be compatible with 2.03 and 3.0b. Once I got an blank page/error, too, but after a browser refresh it was ok.

Can you switch on debugging in gsconfig.php and give me the error message?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#37
Here is what I get:

Quote:Fatal error: Cannot redeclare return_i18n_languages() (previously declared in /home/a5959256/public_html/plugins/i18n_base.php:74) in /home/a5959256/public_html/plugins/i18n.php on line 102
Reply
#38
Angryboy Wrote:Here is what I get:

Quote:Fatal error: Cannot redeclare return_i18n_languages() (previously declared in /home/a5959256/public_html/plugins/i18n_base.php:74) in /home/a5959256/public_html/plugins/i18n.php on line 102

Oh, sorry, i should have described that the file names have changed. You need to remove the i18n.php and i18n directory from the plugins directory, otherwise two versions of i18n are installed in parallel.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#39
Code:
Notice: Use of undefined constant showall - assumed 'showall' in /home/cp068800/public_html/neowebtime.ru/0/admin/inc/theme_functions.php(296) : eval()'d code on line 1
http://neowebtime.ru/0/ww
Reply
#40
Oleg06 Wrote:
Code:
Notice: Use of undefined constant showall - assumed 'showall' in /home/cp068800/public_html/neowebtime.ru/0/admin/inc/theme_functions.php(296) : eval()'d code on line 1
http://neowebtime.ru/0/ww

Did you call get_i18n_navigation with
Code:
get_i18n_navigation(null, 0, 0, showall)
instead of
Code:
get_i18n_navigation(null, 0, 0, true)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#41
Thanks, it works
Reply
#42
mvlcek: would it be possible to create an additional dropdown box/list in page creation window options, where users could choose the language of the page, instead of naming the page with: page_name_en/de/swe/pl/ ?
Addons: getsimple theme, Online Visitors, Notepad
Reply
#43
yojoe Wrote:mvlcek: would it be possible to create an additional dropdown box/list in page creation window options, where users could choose the language of the page, instead of naming the page with: page_name_en/de/swe/pl/ ?

The plugin relies on the url/slug having the _de, ... included. Getting the extension from a drop down and putting it into the url is not possible as there is no appropriate hook in GetSimple. Additionally you would have to configure the allowed languages, ...

However, you only have to add the _de, ... once for each language (e.g. for your index page), then go to the I18N view on the pages tab and click on the + column to create a page in the appropriate language - the url/slug name is filled automatically.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#44
Looking at this and seeing a fast progress of GS, wouldn't it be better to ask for some core changes to allow more user friendly functionalities of some plugins ?
GS power started to rely heavily on them.

You know that I'm not asking for all of this just for my own purposes, as I'm fine with everything, and I can do some small changes. But If I showed your usage guide to a non-technical user, he would look at me with an imploring glance and say (as always): I do not understand even a word
Addons: getsimple theme, Online Visitors, Notepad
Reply
#45
yojoe Wrote:Looking at this and seeing a fast progress of GS, wouldn't it be better to ask for some core changes to allow more user friendly functionalities of some plugins ?

That's done, of course, and some like the hook on a page delete are already implemented (in 3.0b).
But there will always be core changes that are not yet finished or won't be done, because it would make the core too complex and they are only used by very specialized plugins. And then we plugin developers have to work with what we have/get.

Quote:But If I showed your usage guide to a non-technical user, he would look at me with an imploring glance and say (as always): I do not understand even a word

The non-technical user I know does not install GetSimple or plugins and he does not include the links to switch languages in the template. So I install GetSimple, create/improve the template and create (empty) index pages in the languages he/she wants to have on the site.

Then I tell/show him/her to go to the I18N view and select the page from the table or click on the + button, if he/she wants to create a translation of a page. And it seems to work - at least after the second time ;-)

So, yes, it would by nice to have some additional functionality in the core, but we try the best with what we have.
And if you have any suggestions to improve the "user experience", I'm always happy to here them...
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#46
agreed here as well. If something is lacking in the core, I am more than willing to listen as implement if I think it merits it. My job is to keep the core SIMPLE and the UI even simpler.

I am also more than happy to let plugins develop, and then when they are mature enough - and widely used enough - to ask them to be part of the core. I haven't done this yet, but i think its more to the point of there not being a ton of plugins to choose from.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#47
This thing is just damned beautiful, mvlcek. Functional, easy to use and thoroughly expansive. Makes me all the more proud to use Get Simple. Smile

Only thing I think might need addressing is when you have a large number of languages for your site (since the text overflows horizontally out of the admin template). I'm not too sure how this might be solved. Perhaps give the 'editpages' id a unique, fixed width (with CSS) on the I18n page and a scrollbar for when this width is exceeded? I don't know - you're the genius when it comes to intuitive solutions.

Thanks again for this wonderful plugin!

---- *edit* ----
I just realised what also may be a helpful addition (although not a necessary one) - what about a tag that correlates to the language active? It could be outputted on the page in plain text simply to show the active language, or be used in templates for language-specific styling. For example:

Code:
<body id="<?php get_page_slug(); ?>">

Which outputs:

Code:
<body id="index">

May instead be something like:

Code:
<body id="<?php get_page_slug(); ?> <?php get_lang_slug(); ?>" >

So on the 'DE' page it outputs:

Code:
<body id="index de">

This would mean that I can tailor visual elements specifically for certain languages:

Code:
#de #banner { banner stylings specific for deutsch }

The above would mean the German banner can have a different CSS (for instance, with an image that has translated text).

Arbitrary, but perhaps something to consider when you've run out of improvements to make Wink

---- *edit 2* ----
Discovered your CustomFields modified plugin and realised it performs just this feature. Works perfectly, and in more flexible fashion, as always. Smile
Reply
#48
I have released a new version of the I18N plugin (http://get-simple.info/extend/plugin/i18n/69/) with the following (additional) main features:
  • It has a new navigation structure view, where you can arrange the menu with drag and drop (save with Undo!)
  • You can set the default language from the admin GUI
  • It is compatible with GetSimple 3.0b

Note: Please make a backup before saving the navigation structure for the first time. If you save major changes, a lot or even all page files are updated! If you do not undo the changes immediately, you can still do it later manually by copying the files from backups/i18n_navigation to data/pages.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#49
Angryboy Wrote:This thing is just damned beautiful, mvlcek. Functional, easy to use and thoroughly expansive. Makes me all the more proud to use Get Simple. Smile

Thank you.

Angryboy Wrote:Only thing I think might need addressing is when you have a large number of languages for your site (since the text overflows horizontally out of the admin template).

I've thought about that but thought that GetSimple users probably don't have more than 2 or 3 languages on their site.

Angryboy Wrote:I just realised what also may be a helpful addition (although not a necessary one) - what about a tag that correlates to the language active? It could be outputted on the page in plain text simply to show the active language, or be used in templates for language-specific styling.

There is a - probably undocumented - feature: a global variable $language, e.g.:

Code:
<body id="<?php get_page_slug(); ?>" class="lang_<?php echo $language; ?>">

Which outputs something like:

Code:
<body id="index" class="lang_de">

Styling can than be done like this (example: large headers for german):

Code:
.lang_de h1 { font-size: 200%; }
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#50
New version 1.1: You can now also change the menu texts in the navigation structure view.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)
Free HDTV Channels Residential Solar Panels