Closed jpfleury closed 13 years ago
First patch: Translation in French of "file-search.gedit-plugin
file-search.glade
About file-search.glade
, strings are already flagged as translatable with translatable
attribute. Example:
<property name="label" translatable="yes">Only these file types:</property>
but we must extract these strings to create a template. The new target make pot
in the Makefile achieves this, by generating the file file-search.pot
in the new folder file-search-lang
.
Then, to make a translation, we just have to create a .po
file by copying this template and paste it in file-search-lang/LANG/LC_MESSAGES/file-search.po
(replace LANG
with the lang code), for example:
file-search-lang/fr/LC_MESSAGES/file-search.po
If the template was changed, .po
files can be updated with the target make po
.
To make a translation usable in gedit, each .po
file must be compiled into a .mo
binary file. The new target make mo
is used for this.
All these steps can be performed with the single target make tgz
, that depends on both po
and mo
targets.
The following patch adds all needed stuff in Makefile
:
gedit-file-search: patch to make Makefile manage translation
The following file is the translation in French (so the file file-search-lang/fr/LC_MESSAGES/file-search.po
):
gedit-file-search: translation in French
To ignore .mo
binary files with git, apply this patch:
gedit-file-search: patch to ignore .mo
binary files with git
file-search.py
The last modifications needed are about file-search.py
:
_()
, for example _("Expand All")
. Note: the target make pot
already adds to the template all translatable strings found in file-search.py
.The following patch solves these 3 points:
Wow, nice work - thanks a lot!
It would be good if we could get this integrated on the new "subdir" branch (https://github.com/oliver/gedit-file-search/tree/subdir) which already puts all files into a new subdirectory. I'll see to get the subdir stuff finished and will then merge the translation code.
OK. Surely patches will need some adjustments. Say me when I can use https://github.com/oliver/gedit-file-search/tree/subdir to modify them.
In the meantime, I'll modify a little bit my patch for file-search.py
, because it interferes with gedit translation.
Problem solved. The patch has been updated.
The subdir branch has been merged into master branch now, so you can do any adjustments based on master.
Cool. I test my patches right now.
Sorry, I had forgotten to adjust the Makefile for the subdirectory move. It's updated now - can you take that into account yet?
No problem.
All patches have been updated:
file-search.gedit-plugin
: https://gist.github.com/976500file-search/ui.py
: https://gist.github.com/977770Makefile
: https://gist.github.com/977758.gitignore
: https://gist.github.com/977772.po
file): https://gist.github.com/977761Ok, pushed to i18n branch now (https://github.com/oliver/gedit-file-search/tree/i18n) - thanks a lot!
Btw. should the .pot file be checked in as well?
Thanks!
Btw. should the .pot file be checked in as well?
I don't think it should be versioned, because it's automatically generated with make pot
.
I would like to help making this plugin translatable. I'll try to provide patches.