Thread: [Tuxpaint-i18n] Some strings not translating (website)
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Pere P. i C. <pe...@fo...> - 2008-12-20 13:20:15
|
Hi! Some things I've find so far: ################# Not gettext(ed): from videos/index.php3: <li><a href="http://prdownloads.sourceforge.net/tuxpaint/TuxPTemp.zip?download">Download TuxPTemp.zip from SourceForge.net</a> (March 2005, 10MB) <li><a href="http://prdownloads.sourceforge.net/tuxpaint/2006-07-11_tuxpaint.ogg?download">Download 2006-07-11_tuxpaint.ogg from SourceForge.net</a> ################ gettext(ed) in gallery/index.php3 but not appearing in the .pot file: echo sprintf(gettext("The following is a gallery of %1$d pictures drawn by %2$d children (and adults) around the world using Tux Paint:"), $num_picts, $num_artists); echo "<p><font size=-1>". gettext("Watch for updates using the <a href= \"$TP_BASE/gallery/gallery-as-rss.php\">Tux Paint Artist Gallery RSS Feed</a>!") . "</font></p>\n"; ################ gettext(ed) in gallery/index.php3, appearing in the po files but not displaying translated in the web site: #: ../gallery/index.php3:49 ../gallery/index.php3:53 #, php-format msgid "Main Gallery (page %1$s/%2$s)" #: ../gallery/index.php3:58 #, php-format msgid "Artist Gallery — %s" #. Show artist's info: #: ../gallery/index.php3:67 #, php-format msgid "Artwork by %s" I've tryed to do a update-po.sh , but I get an error in the intltool line: LC_ALL=C ./update-po.sh Cannot find top_srcdir in Makefile. at /usr/bin/intltool-update line 1032. and the pot file is not regenerated. Hope this helps Pere |
From: Pere P. i C. <pe...@fo...> - 2008-12-21 01:24:21
|
El ds 20 de 12 de 2008 a les 14:19 +0100, en/na Pere Pujal i Carabantes va escriure: > Hi! > ################ > gettext(ed) in gallery/index.php3 but not appearing in the .pot file: > > echo sprintf(gettext("The following is a gallery of %1$d pictures drawn > by %2$d children (and adults) around the world using Tux Paint:"), > $num_picts, $num_artists); > Changing this to ...gallery of %1d pictures....by %2d children.... and just works, appears in the po files and, if translated, displays in the site. Now I don't have the time to heavy check and commit, sorry HTH Pere |
From: F W. <fr...@tr...> - 2008-12-21 06:50:03
|
On So, 2008-12-21 at 02:24 +0100, Pere Pujal i Carabantes wrote: > El ds 20 de 12 de 2008 a les 14:19 +0100, en/na Pere Pujal i Carabantes > va escriure: > > Hi! > > > ################ > > gettext(ed) in gallery/index.php3 but not appearing in the .pot file: > > > > echo sprintf(gettext("The following is a gallery of %1$d pictures drawn > > by %2$d children (and adults) around the world using Tux Paint:"), > > $num_picts, $num_artists); > > > > Changing this to ...gallery of %1d pictures....by %2d children.... > and just works, appears in the po files and, if translated, displays in > the site. This should be using ngettext to handle the noun forms correctly. "pictures" and "children" might need to change according to the values of the variables. Since there are two dependent variables in the sentence, we'll have to have at least two separate calls to ngettext to handle them correctly. Friedel -- Recently on my blog: http://translate.org.za/blogs/friedel/en/content/re-bringing-all-translation-management-tools-together |
From: Pere P. i C. <pe...@fo...> - 2008-12-21 19:07:15
|
El dg 21 de 12 de 2008 a les 08:49 +0200, en/na F Wolff va escriure: > On So, 2008-12-21 at 02:24 +0100, Pere Pujal i Carabantes wrote: > > El ds 20 de 12 de 2008 a les 14:19 +0100, en/na Pere Pujal i Carabantes > > va escriure: > > > Hi! > > > > > ################ > > > gettext(ed) in gallery/index.php3 but not appearing in the .pot file: > > > > > > echo sprintf(gettext("The following is a gallery of %1$d pictures drawn > > > by %2$d children (and adults) around the world using Tux Paint:"), > > > $num_picts, $num_artists); > > > > > > > Changing this to ...gallery of %1d pictures....by %2d children.... > > and just works, appears in the po files and, if translated, displays in > > the site. This don't allow to swap the variables, instead just changing the double quotes to single quotes, seems to work right even with swapped variables. > > This should be using ngettext to handle the noun forms correctly. > "pictures" and "children" might need to change according to the values > of the variables. Since there are two dependent variables in the > sentence, we'll have to have at least two separate calls to ngettext to > handle them correctly. Is ngettext really needed?, the two variables are currently 520 pictures and 160 childs, I doubt they will never go below 100. Yours Pere |
From: F W. <fr...@tr...> - 2008-12-21 19:35:47
|
On So, 2008-12-21 at 20:07 +0100, Pere Pujal i Carabantes wrote: > El dg 21 de 12 de 2008 a les 08:49 +0200, en/na F Wolff va escriure: > > On So, 2008-12-21 at 02:24 +0100, Pere Pujal i Carabantes wrote: > > > El ds 20 de 12 de 2008 a les 14:19 +0100, en/na Pere Pujal i Carabantes ... > > This should be using ngettext to handle the noun forms correctly. > > "pictures" and "children" might need to change according to the values > > of the variables. Since there are two dependent variables in the > > sentence, we'll have to have at least two separate calls to ngettext to > > handle them correctly. > > Is ngettext really needed?, the two variables are currently 520 pictures > and 160 childs, I doubt they will never go below 100. Hallo Pere I believe there are languages that consistently have different noun forms, no matter how large things get. In Arabic, for example, noun forms are selected differently for different ranges in each 100. Quite a few languages seem to have similar behaviour. For more information see: http://translate.sourceforge.net/wiki/l10n/pluralforms Keep well Friedel -- Recently on my blog: http://translate.org.za/blogs/friedel/en/content/re-bringing-all-translation-management-tools-together |
From: Pere P. i C. <pe...@fo...> - 2008-12-22 19:03:39
|
El dg 21 de 12 de 2008 a les 21:35 +0200, en/na F Wolff va escriure: > On So, 2008-12-21 at 20:07 +0100, Pere Pujal i Carabantes wrote: > > El dg 21 de 12 de 2008 a les 08:49 +0200, en/na F Wolff va escriure: > > > This should be using ngettext to handle the noun forms correctly. > > > "pictures" and "children" might need to change according to the values > > > of the variables. Since there are two dependent variables in the > > > sentence, we'll have to have at least two separate calls to ngettext to > > > handle them correctly. Aproximately something like this?: /*This string and the following will be concatenated*/ $pict_text=sprintf(ngettext('The following is a gallery of %1$d picture ','The following is a gallery of %1$d pictures ',$num_picts), $num_picts); /*This string and the preceding will be concatenated*/ $child_text=sprintf(ngettext('drawn by %1$d child around the world using Tux Paint:','drawn by %1$d children (and adults) around the world using Tux Paint:',$num_artists),$num_artists); /*Here you can swap the two preceding strings*/ echo sprintf(gettext('%1$s%2$s'), $pict_text, $child_text); This adds a lot of complexity... > > > > Is ngettext really needed?, the two variables are currently 520 pictures > > and 160 childs, I doubt they will never go below 100. > > Hallo Pere > > I believe there are languages that consistently have different noun > forms, no matter how large things get. In Arabic, for example, noun > forms are selected differently for different ranges in each 100. Quite > a few languages seem to have similar behaviour. For more information > see: > > http://translate.sourceforge.net/wiki/l10n/pluralforms Thanks for the link, I see there are a lot of things I have to learn about languages :) Yours Pere |
From: F W. <fr...@tr...> - 2008-12-22 20:09:27
|
On Ma, 2008-12-22 at 20:03 +0100, Pere Pujal i Carabantes wrote: > > Aproximately something like this?: > > /*This string and the following will be concatenated*/ > $pict_text=sprintf(ngettext('The following is a gallery of %1$d > picture ','The following is a gallery of %1$d pictures ',$num_picts), > $num_picts); > > /*This string and the preceding will be concatenated*/ > $child_text=sprintf(ngettext('drawn by %1$d child around the world > using Tux Paint:','drawn by %1$d children (and adults) around the > world using Tux Paint:',$num_artists),$num_artists); > > /*Here you can swap the two preceding strings*/ > echo sprintf(gettext('%1$s%2$s'), $pict_text, $child_text); > > This adds a lot of complexity... You are correct - it does add complexity. We'll have to decide if it is worth it. Your example creates other problems though. The variables can't be repositioned easily. Concatenated strings are often very hard to translate. If we want to support both variables properly, something like this might work: /*This string will be substituted into the following one*/ $pict_text=sprintf(ngettext('%1$d picture','%1$d pictures', num_picts), $num_picts); /*The first variable is text like '5 pictures' from the previous string*/ echo sprintf(ngettext('The following is a gallery of %1$s drawn by %2$d child around the world using Tux Paint:','The following is a gallery of %1$s drawn by %2$d children around the world using Tux Paint:',$num_artists), $pict_text, $num_artists); I'm guess this still doesn't solve it for all languages. I foresee that the translation of "drawn" might be dependent on the number of pictures. The easy way out is to not construct a sentence, but do something more similar to "headings", or to use two separate sentences: Gallery statistics: x pictures y children or The gallery contains X pictures. Y children contributed pictures to the gallery. If we really want to support all languages, it is a bit harder :-) Keep well Friedel -- Recently on my blog: http://translate.org.za/blogs/friedel/en/content/re-bringing-all-translation-management-tools-together |
From: Bill K. <nb...@so...> - 2008-12-22 23:00:13
|
On Mon, Dec 22, 2008 at 10:08:57PM +0200, F Wolff wrote: > You are correct - it does add complexity. We'll have to decide if it is > worth it. Your example creates other problems though. The variables > can't be repositioned easily. Concatenated strings are often very hard > to translate. Ok, you guys come up with something that's simple enough. I'm fine with changing the original text to something that's easier to deal with, like: > The gallery contains X pictures. Y children contributed pictures to the > gallery. Is that good? -bill! |
From: Pere P. i C. <pe...@fo...> - 2008-12-23 18:02:40
|
El dl 22 de 12 de 2008 a les 14:07 -0800, en/na Bill Kendrick va escriure: > On Mon, Dec 22, 2008 at 10:08:57PM +0200, F Wolff wrote: > > You are correct - it does add complexity. We'll have to decide if it is > > worth it. Your example creates other problems though. The variables > > can't be repositioned easily. Concatenated strings are often very hard > > to translate. > > Ok, you guys come up with something that's simple enough. I'm fine with > changing the original text to something that's easier to deal with, like: > > > > The gallery contains X pictures. Y children contributed pictures to the > > gallery. > > Is that good? It's good for me. There will be two ngettext calls, one for each sentence, I don't see any problems here. > > -bill! > Merry Xmass to all! Pere |
From: Pere P. i C. <pe...@fo...> - 2009-01-01 23:33:02
|
El ds 20 de 12 de 2008 a les 14:19 +0100, en/na Pere Pujal i Carabantes va escriure: > gettext(ed) in gallery/index.php3, appearing in the po files but not > displaying translated in the web site: > > #: ../gallery/index.php3:49 ../gallery/index.php3:53 > #, php-format > msgid "Main Gallery (page %1$s/%2$s)" > > #: ../gallery/index.php3:58 > #, php-format > msgid "Artist Gallery — %s" > #. Show artist's info: > #: ../gallery/index.php3:67 > #, php-format > msgid "Artwork by %s" This latest should be #: ../gallery/index.php3:36 #, php-format msgid "All Artwork by %s" Sorry I think I figured out why those doesn't appear translated: some titles in gallery are composed by two of those strings, so when trying to gettext a composed title in layout/std.php3, there is not a translation that matches the composed title. Does this make sense? Pere |
From: Bill K. <nb...@so...> - 2009-01-02 09:17:37
|
On Fri, Jan 02, 2009 at 12:32:33AM +0100, Pere Pujal i Carabantes wrote: > I think I figured out why those doesn't appear translated: > some titles in gallery are composed by two of those strings, so when > trying to gettext a composed title in layout/std.php3, there is not a > translation that matches the composed title. > > Does this make sense? I think so, but I'm too slow and tired right now to look into it. Feel free to change things in CVS and commit, and I'll pull it down on the webserver. :) Thanks, and happy new year! -- -bill! "Tux Paint" - free children's drawing software for Windows / Mac OS X / Linux! Download it today! http://www.tuxpaint.org/ |
From: Pere P. i C. <pe...@fo...> - 2009-01-02 23:40:59
|
Hi Bill! El dv 02 de 01 de 2009 a les 01:17 -0800, en/na Bill Kendrick va escriure: > On Fri, Jan 02, 2009 at 12:32:33AM +0100, Pere Pujal i Carabantes wrote: > > I think I figured out why those doesn't appear translated: > > some titles in gallery are composed by two of those strings, so when > > trying to gettext a composed title in layout/std.php3, there is not a > > translation that matches the composed title. There is another problem in plus of what I said about composed strings, $specifics contains yet the substituted values, so if it is on the title, it is currently untranslatable. > > > > Does this make sense? > > I think so, but I'm too slow and tired right now to look into it. > Feel free to change things in CVS and commit, and I'll pull it down on the > webserver. :) I think that the real solution will be to get gettext working before calling page_start, say a start_gettext() function in layout/std.php3 that one can call as needed, but this is out of my knowledge. For now, I've commited something less intrussive, it works, but it adds an extra line in the page :( the call to page_start() has now a fixed string as title and has gone up to top as it starts gettext needed to have $specifics translated. A new line is added with the contents of $specifics (before it was on the title) Hope this helps Happy new year! Pere |
From: Bill K. <nb...@so...> - 2009-01-03 00:07:53
|
On Sat, Jan 03, 2009 at 12:40:34AM +0100, Pere Pujal i Carabantes wrote: > For now, I've commited something less intrussive, it works, but it adds > an extra line in the page :( I don't like that the <title> loses the specific details. (I don't want _every_ page of the gallery to have an identical, ambiguous title.) Gotta run, -bill! |
From: Pere P. i C. <pe...@fo...> - 2009-01-03 23:50:59
|
El dv 02 de 01 de 2009 a les 16:07 -0800, en/na Bill Kendrick va escriure: > On Sat, Jan 03, 2009 at 12:40:34AM +0100, Pere Pujal i Carabantes wrote: > > For now, I've commited something less intrussive, it works, but it adds > > an extra line in the page :( > > I don't like that the <title> loses the specific details. > (I don't want _every_ page of the gallery to have an identical, ambiguous > title.) > A new attempt, I've made a start_gettext() function by copy/pasting code from page_start() and page_start2(). <title> has recovered the details and translations work fine, but there are some duplicate code now... Pere |