Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Translation Plugin
#1
Based on a discussion in the developer forum some guide lines for handling translations and language files have been developed.

To simplify translating GetSimple and plugins conforming to said guide lines I have developed the Translate plugin:
  • You can select GetSimple or any of the plugins for translation
  • If the plugin is translatable you see the translation statistics and can choose a source and target language for the translation
  • You can filter the list with the texts by a search text or by only showing missing entries
  • Edit the texts and save them
  • Future feature: Submit the translation to GetSimple Extend

For Developers:
  • Develop your plugin as described in the guide lines and create a lang directory.
  • Use the Translate plugin: it will scan your source code and retrieve all codes for translation
  • Create default translations (probably english) using the Translate plugin
  • Wait for the public to provide further translations ;-)

Installation

Download the plugin from http://get-simple.info/extend/plugin/translate/112/ and unzip it into the plugins directory.

Usage

Go to the Plugins/Translate view in the admin back-end.

Trouble Shooting

If you get an error when saving:
  • create a directory backups/translate and make sure it's writable
  • make sure that all language directories (admin/lang and plugins/lang) are writable
  • if you want to update a language file, make sure, it's writable
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#2
Following on from this post:
I Wrote:Translate v0.2.2: No change with the GS core language file. I click 'Save' and I just go back to the previous screen. No messages, no GSDEBUG errors. Same result with Chrome. It does work with the language file from i18n Base.

Incidentally, this is with Firefox and Chrome on a Debian desktop, though that should not be significant.
Translate v0.3 works as advertised. (y)
--
Nick.
Reply
#3
I still have no ideo how to publish the translated language files ... I create a language file, I add it to a post here in the forum, only the readers which come by occassionally see this file

shall we force the plugin dev's to include the language files?
shall we publish them separately thus getting too long lists in the extend-directory?

my suggestion:

a new category in the EXTEND:
- plugin language files
- language files are uploaded zipped, with the name of the zip: nameOfPlugin_VersionOfPlugin_language_Code, for example gsgallery-simple-image-gallery_2.5.3._de_DE.ZIP

is this possible?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#4
Connie Wrote:I still have no ideo how to publish the translated language files ...
This is another unfortunate consequence of a local translation tool, imo.
--
Nick.
Reply
#5
Connie Wrote:I still have no ideo how to publish the translated language files ... I create a language file, I add it to a post here in the forum, only the readers which come by occassionally see this file

The goal for the Translate plugin would be to have a button to submit the language to Extend. However, this needs changes in Extend. For now, I'd suggest you post the language files in the plugin's forum thread. Then we plugin developers can add them to the plugin.

Regarding how we want languages handles by GetSimple and Extend, I have created a new topic and suggest moving the discussion there: The Future of Languages in GetSimple.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
I suggest to only show the missing strings by default because it's a little annoying to try to search them manually (and personally I have a very slow computer and it gets lag when the list loads).
GS fan
Reply
#7
ldac Wrote:I suggest to only show the missing strings by default because it's a little annoying to try to search them manually (and personally I have a very slow computer and it gets lag when the list loads).

You don't have to search manually, there is a button on top to hide all other rows.

Regarding loading: it is slow because of the auto-grow textareas (javascript). If you use e.g. Chrome instead of Firefox 3.6, it is much faster. Loading only a part of the list would make the plugin much more complex and the user interface less intuitive.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#8
How about using fixed height text areas, calculating textarea height by length of original text? Not all users want to use Chrome, some even may have slower computers (netbooks, tablets, mobile devices).
Reply
#9
mvlcek Wrote:
ldac Wrote:I suggest to only show the missing strings by default because it's a little annoying to try to search them manually (and personally I have a very slow computer and it gets lag when the list loads).

You don't have to search manually, there is a button on top to hide all other rows.

Regarding loading: it is slow because of the auto-grow textareas (javascript). If you use e.g. Chrome instead of Firefox 3.6, it is much faster. Loading only a part of the list would make the plugin much more complex and the user interface less intuitive.

I use Opera.

I mean to show, by default, the missing strings without removing the "All" "Missing" options.
GS fan
Reply
#10
Useful plugin! Much more easy than to go through the php file.

I just have a little bug when I used apostrophe for french (ex: "qu'ils"). When I saved it automatically add \ before ' (even if there is already one) but at display they also appear (ex: "qu'ils" become "qu\'ils").
This backslash doesn't seem necessary to display correctly


In addition, the french translation
Sorry my English is poor, I'm working on it
Reply
#11
Translate version 0.4:
  • solves a problem with saving single quotes
  • includes french translations (thanks @Lithie)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#12
Please add support for transliteration arrays - currently if TRANSLITERATION variable was in language file, translation plugin won't save it.
Reply
#13
Joshas,

I translated the german language file using the Translation plugin version 0.4 and the string "Transliteration" was saved fine, so maybe there was a handling error?

I even created a new language file for testing, de_test, and translated that string

the translation "was ein quatsch soll das sein" was saved successfully
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#14
TRANSLITERATION is not simple string variable, it is an array, so current implementation of Translate plugin doesn't handle it correctly. Would be nice if it somehow could be fixed.
Reply
#15
sorry, that I did not see

so in general the translation plugin should be extended to identify arrays and offer their content for translation as well
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#16
Star 
Guys, for avoiding complications and troubles, I suggest you try this software for translations: https://poeditor.com/. It's a nice and clean alternative. Best of luck!
Reply
#17
(2013-05-10, 00:27:13)Tressa Wrote: Guys, for avoiding complications and troubles, I suggest you try this software for translations: https://poeditor.com/. It's a nice and clean alternative. Best of luck!

Poeditor does not support importing PHP arrays, which are used for translations in GetSimple.
And the translate plugin already supports transifex.com
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#18
issues
missing cancel anchor closing tag
tbody bad closing tag

PHP Code:
--- \plugins\translate\translate.php 
+++ (clipboard
@@ -
228,+228,@@
           <
td><input type="radio" name="source" value="" checked="checked"/> <?php i18n('translate/NONE'); ?></td>
           <td><input type="radio" name="target" value="" checked="checked"/> <?php i18n('translate/NEW'); ?></td>
         </tr>
-      <tbody>
+      </tbody>
     </table>
     <input type="hidden" name="plugin" value="<?php echo htmlspecialchars($plugin); ?>"/>
     <input type="submit" class="submit" name="translate" value="<?php i18n('translate/TRANSLATE'); ?>"/>    
@@ -287,7 +287,7 @@
     <p id="submitline">
       <input type="submit" class="submit" name="save" value="<?php i18n('translate/SAVE'); ?>"/> 
       &nbsp;&nbsp; <?php i18n('OR'); ?> &nbsp;&nbsp;
-      <a class="cancel" href="load.php?id=translate&select&plugin=<?php echo urlencode($plugin); ?>"><?php i18n('CANCEL'); ?> 
+      <a class="cancel" href="load.php?id=translate&select&plugin=<?php echo urlencode($plugin); ?>"><?php i18n('CANCEL'); ?></a> 
     </p>
     </form>
     <script type="text/javascript" src="../plugins/translate/js/jquery.autogrow.js"></script> 
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#19
Thank you shawn_a.

It's fixed in version 1.0, which can download/upload files from/to transifex (experimental) - I only now saw that I never uploaded it to Extend.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#20
Does this plugin still work and is anyone using it? When I try to use it for a plugin, most of the time I get this text:

Quote:This plugin does not support internationalization or does not conform to the internationalization guide lines of GetSimple. Please contact the plugin developer, if you see a need to translate (part of) this plugin.

If not I see nothing and also the menu on the right is gone. In errorlog I see:

Quote:PHP Fatal error: Cannot access empty property in ... /plugins/translate/translate.php on line 89
Reply
#21
Which plugin(s) are you trying to translate?
(For the record, GS Custom Settings, GSconfig UI & AdminXML Plus are not compatible with this plugin)
Reply
#22
(2015-06-04, 04:08:10)datiswous Wrote: Does this plugin still work and is anyone using it? When I try to use it for a plugin, most of the time I get this text:


Quote:This plugin does not support internationalization or does not conform to the internationalization guide lines of GetSimple. Please contact the plugin developer, if you see a need to translate (part of) this plugin.

If not I see nothing and also the menu on the right is gone. In errorlog I see:


Quote:PHP Fatal error:  Cannot access empty property in ... /plugins/translate/translate.php on line 89

It should work for all plugins that are using internationalization, i.e. that have the folder plugins/<pluginname>/lang and at least one file in it. Additionally it should work for all plugins in development that use the i18n functions of GetSimple, but do not yet have language files.

As for the error: it should/could only happen, if you clicked on "Transifex" (which is experimental) and entered a username and password.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#23
(2015-06-05, 00:51:35)mvlcek Wrote: It should work for all plugins that are using internationalization, i.e. that have the folder plugins/<pluginname>/lang and at least one file in it. Additionally it should work for all plugins in development that use the i18n functions of GetSimple, but do not yet have language files.

As for the error: it should/could only happen, if you clicked on "Transifex" (which is experimental) and entered a username and password.

If I have auto-fill for (GetSimple) login enabled in browser, these login fields are automatically filled in the login box of the transifex login form, which then gives that error and functionality gone. If I disable password saving for login of GS, plugin works fine.

Tested in Firefox and Chrome
Reply
#24
yeah browsers have pretty shitty password field controls. We have the same issue in our profile settings. Just erase the fields when saving.....
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#25
(2015-06-05, 05:14:50)shawn_a Wrote: yeah browsers have pretty shitty password field controls. We have the same issue in our profile settings.

Yeah I had that as well some time ago..
Reply




Users browsing this thread: 1 Guest(s)