Posts: 2,094
Threads: 54
Joined: Jan 2011
2011-03-26, 01:55:52
(This post was last modified: 2013-01-06, 02:45:42 by mvlcek.)
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
Posts: 423
Threads: 15
Joined: Mar 2011
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.
Posts: 2,928
Threads: 195
Joined: Feb 2011
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?
Posts: 423
Threads: 15
Joined: Mar 2011
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.
Posts: 2,094
Threads: 54
Joined: Jan 2011
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.
Posts: 13
Threads: 3
Joined: Feb 2011
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
Posts: 2,094
Threads: 54
Joined: Jan 2011
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.
Posts: 75
Threads: 9
Joined: Mar 2010
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).
Posts: 13
Threads: 3
Joined: Feb 2011
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
Posts: 13
Threads: 0
Joined: Sep 2011
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
Posts: 2,094
Threads: 54
Joined: Jan 2011
Translate version 0.4: - solves a problem with saving single quotes
- includes french translations (thanks @Lithie)
Posts: 75
Threads: 9
Joined: Mar 2010
Please add support for transliteration arrays - currently if TRANSLITERATION variable was in language file, translation plugin won't save it.
Posts: 2,928
Threads: 195
Joined: Feb 2011
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
Posts: 75
Threads: 9
Joined: Mar 2010
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.
Posts: 2,928
Threads: 195
Joined: Feb 2011
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
Posts: 1
Threads: 0
Joined: May 2013
2013-05-10, 00:27:13
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!
Posts: 2,094
Threads: 54
Joined: Jan 2011
(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
Posts: 6,266
Threads: 181
Joined: Sep 2011
issues
missing cancel anchor closing tag
tbody bad closing tag
PHP Code: --- \plugins\translate\translate.php +++ (clipboard) @@ -228,7 +228,7 @@ <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'); ?>"/> <?php i18n('OR'); ?> - <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>
Posts: 2,094
Threads: 54
Joined: Jan 2011
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.
Posts: 1,247
Threads: 82
Joined: Feb 2011
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
Posts: 305
Threads: 15
Joined: Mar 2014
Which plugin(s) are you trying to translate?
(For the record, GS Custom Settings, GSconfig UI & AdminXML Plus are not compatible with this plugin)
Posts: 2,094
Threads: 54
Joined: Jan 2011
(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.
Posts: 1,247
Threads: 82
Joined: Feb 2011
2015-06-05, 04:55:31
(This post was last modified: 2015-06-05, 05:08:51 by datiswous.)
(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
Posts: 6,266
Threads: 181
Joined: Sep 2011
yeah browsers have pretty shitty password field controls. We have the same issue in our profile settings. Just erase the fields when saving.....
Posts: 1,247
Threads: 82
Joined: Feb 2011
(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..
|