* [sup-talk] i18n? @ 2009-09-30 23:30 Christopher Bertels 2009-10-01 16:44 ` William Morgan 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-09-30 23:30 UTC (permalink / raw) Hi, are there any plans on doing some internationalization? If not, would people like to have something like this, now that I have mentioned it? ;) I guess something yaml-based could work, there are some good libraries out there afaik. Why this came to my mind: I usually write mails in german and english and have done a custom patch to check for the german word for "attachment" to warn me before sending an email, if I haven't yet added an attachment to a composed mail. This obviously works for english right now, but I wanted to have a similar feature in german. Since adding language specific options all over the code really isn't the right way, maybe having some kind of language packs would be nice. I could take care of some german translation (and I suppose I'm not the only one on this list ;)) Cheers, Christopher. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 902 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20091001/d6569555/attachment.bin> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-09-30 23:30 [sup-talk] i18n? Christopher Bertels @ 2009-10-01 16:44 ` William Morgan 2009-10-01 18:15 ` Christopher Bertels ` (2 more replies) 0 siblings, 3 replies; 29+ messages in thread From: William Morgan @ 2009-10-01 16:44 UTC (permalink / raw) Reformatted excerpts from Christopher Bertels's message of 2009-09-30: > are there any plans on doing some internationalization? If not, would > people like to have something like this, now that I have mentioned it? I have no immediate plans personally, but I would love to have this in Sup. > I guess something yaml-based could work, there are some good libraries > out there afaik. There is a Ruby-Gettext package, which we already use for other reasons. I think this is probably the best thing to start with, unless it turns out to be too hard to use, in which case we could consider a custom solution. http://www.yotabanana.com/hiki/ruby-gettext.html > I could take care of some german translation (and I suppose I'm not > the only one on this list ;)) I know we have a fair amount of German and French representation on the list, and that's probably representative of the user population in general. So you should have an appreciative audience. -- William <wmorgan-sup at masanjin.net> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 16:44 ` William Morgan @ 2009-10-01 18:15 ` Christopher Bertels 2009-10-01 18:24 ` William Morgan 2009-10-01 18:21 ` Christopher Bertels 2009-10-01 18:33 ` Christopher Bertels 2 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-01 18:15 UTC (permalink / raw) Excerpts from William Morgan's message of Do Okt 01 18:44:43 +0200 2009: > I have no immediate plans personally, but I would love to have this in > Sup. Alright, good to know. > There is a Ruby-Gettext package, which we already use for other reasons. > I think this is probably the best thing to start with, unless it turns > out to be too hard to use, in which case we could consider a custom > solution. > > http://www.yotabanana.com/hiki/ruby-gettext.html Cool, I'll have a look at it. Another reason for adding this would be that for example gpg's output is different for me (in german) than what sup expects. So trust-paths for example aren't recognized by default, since the regular expression in crypto.rb only looks for english output. I fixed this for myself but I figured it would make more sense to put this kind of stuff to a central location. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20091001/cf2f42a4/attachment.bin> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 18:15 ` Christopher Bertels @ 2009-10-01 18:24 ` William Morgan 2009-10-02 0:19 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: William Morgan @ 2009-10-01 18:24 UTC (permalink / raw) Reformatted excerpts from Christopher Bertels's message of 2009-10-01: > Another reason for adding this would be that for example gpg's output > is different for me (in german) than what sup expects. So trust-paths > for example aren't recognized by default, since the regular expression > in crypto.rb only looks for english output. It will be interesting to see how gettext handles the case of regular expressions (which is also probably what you want for the "attachment" detector). If it's not natural to wedge regexen into gettext, we should consider a custom solution. -- William <wmorgan-sup at masanjin.net> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 18:24 ` William Morgan @ 2009-10-02 0:19 ` Christopher Bertels 2009-10-02 12:52 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-02 0:19 UTC (permalink / raw) Excerpts from William Morgan's message of Do Okt 01 20:24:57 +0200 2009: > It will be interesting to see how gettext handles the case of regular > expressions (which is also probably what you want for the "attachment" > detector). If it's not natural to wedge regexen into gettext, we should > consider a custom solution. Hmm. Well I started working on something simple based on yaml files. I looked at gettext but that seemed a little weird to me. Since Ruby's yaml module supports regular expressions, this is a plus point, I guess. It worked with the attachments example. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 902 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20091002/9c56d49e/attachment.bin> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-02 0:19 ` Christopher Bertels @ 2009-10-02 12:52 ` Christopher Bertels 2009-10-05 16:00 ` Christopher Bertels 2009-10-23 7:00 ` Tero Tilus 0 siblings, 2 replies; 29+ messages in thread From: Christopher Bertels @ 2009-10-02 12:52 UTC (permalink / raw) I've uploaded what I've done so far to http://www.gitorious.org/~bakkdoor/sup/bakkdoors-clone/trees/i18n You can get it via git here: git://gitorious.org/~bakkdoor/sup/bakkdoors-clone.git (branch: i18n) Please tell me what you think. I know it's pretty simple but for now I guess that's all we need. Or am I missing something? One thing I wanted to add as well is, that if there is no translation found for a different language, it will default to the english version (instead of returning nil). -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-02 12:52 ` Christopher Bertels @ 2009-10-05 16:00 ` Christopher Bertels 2009-10-06 15:38 ` William Morgan 2009-10-23 7:00 ` Tero Tilus 1 sibling, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-05 16:00 UTC (permalink / raw) To: sup-talk I think I've translated most of sup's UI-related part (translating error messages doesn't seem like a good idea, since we really don't want multilingual bug-reports and exception logs...) I'd like to hear some feedback and/or opinions/suggestions and would like to see it integrated into sup. I'll add more translations, if I find anything I havent missed yet and that is part of the user interface. Cheers, Christopher. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-05 16:00 ` Christopher Bertels @ 2009-10-06 15:38 ` William Morgan 2009-10-06 20:35 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: William Morgan @ 2009-10-06 15:38 UTC (permalink / raw) To: sup-talk Hi Christopher, Reformatted excerpts from Christopher Bertels's message of 2009-10-05: > I'd like to hear some feedback and/or opinions/suggestions and would > like to see it integrated into sup. I'll add more translations, if I > find anything I havent missed yet and that is part of the user > interface. This looks great. A couple comments: 1. I would prefer that uppercase substitution symbols made lowercase. The uppercase seems weird and un-Rubyish to me. 2. I think it would be nice to have a simple module along the lines of: module M17n def m s, o={}; I18n[m, o] end end and to have that be the primary entry point when you want a translated string. Then classes can include that module if they want m17n support, and instead of writing I18n["text", { :var => value }] you can have m("text", :var => value) which is a little easier to read, IMO. 3. Should we call it m17n instead of i18n? I think that might be a little more accurate. Perhaps too nitpicky. What do you think? 4. A finishing touch would be to have sup-config ask the user what language they are interested in. -- William <wmorgan-sup@masanjin.net> _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-06 15:38 ` William Morgan @ 2009-10-06 20:35 ` Christopher Bertels 2009-10-06 21:56 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-06 20:35 UTC (permalink / raw) To: sup-talk [-- Attachment #1.1: Type: text/plain, Size: 1518 bytes --] Excerpts from William Morgan's message of Di Okt 06 17:38:39 +0200 2009: > This looks great. A couple comments: Cool, good to know you like it! > 1. I would prefer that uppercase substitution symbols made lowercase. > The uppercase seems weird and un-Rubyish to me. Ok, sounds good. I thought making them uppercase to let them be more distict from the rest of the string but since we surround them by #{} as in Ruby, you're making a good point here. I'll change that. > 2. I think it would be nice to have a simple module along the lines of: > > module M17n > def m s, o={}; I18n[m, o] end > end > > and to have that be the primary entry point when you want a translated > string. Then classes can include that module if they want m17n support, > and instead of writing > > I18n["text", { :var => value }] > > you can have > > m("text", :var => value) > > which is a little easier to read, IMO. Same here. Think this is nicer, too. > 3. Should we call it m17n instead of i18n? I think that might be a > little more accurate. Perhaps too nitpicky. What do you think? I couldn't care less about the name - but I guess m17n fits better, since it's just multilingualization. :) > 4. A finishing touch would be to have sup-config ask the user what > language they are interested in. Alright, cool. I'll add that as well, once I have the rest changed & working. Cheers, Christopher. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 140 bytes --] _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-06 20:35 ` Christopher Bertels @ 2009-10-06 21:56 ` Christopher Bertels 2009-10-20 12:33 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-06 21:56 UTC (permalink / raw) To: sup-talk OK, I've changed it as mentioned. See my previously mentioned gitorious branch. Cheers, Christopher. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-06 21:56 ` Christopher Bertels @ 2009-10-20 12:33 ` Christopher Bertels 2009-10-21 12:29 ` Fabio Riga 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-20 12:33 UTC (permalink / raw) To: sup-talk [-- Attachment #1.1: Type: text/plain, Size: 198 bytes --] Just wondering, if anyone is still interested in this, since no one has replied yet. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 140 bytes --] _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-20 12:33 ` Christopher Bertels @ 2009-10-21 12:29 ` Fabio Riga 2009-10-21 16:41 ` Guillaume Quintard 2009-10-21 18:37 ` Christopher Bertels 0 siblings, 2 replies; 29+ messages in thread From: Fabio Riga @ 2009-10-21 12:29 UTC (permalink / raw) To: sup-talk Excerpts from Christopher Bertels's message of mar ott 20 14:33:35 +0200 2009: > Just wondering, if anyone is still interested in this, since no one has replied > yet. Well, I'm really interested, but I'm just a user. I could only make Italian translation, but how? Is it a normal gettext .po file? What I have to do? Cheers, Fabio _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-21 12:29 ` Fabio Riga @ 2009-10-21 16:41 ` Guillaume Quintard 2009-10-21 18:37 ` Christopher Bertels 1 sibling, 0 replies; 29+ messages in thread From: Guillaume Quintard @ 2009-10-21 16:41 UTC (permalink / raw) To: sup-talk > Excerpts from Christopher Bertels's message of mar ott 20 14:33:35 +0200 2009: > Well, I'm really interested, but I'm just a user. I could only make > Italian translation, but how? Is it a normal gettext .po file? What I > have to do? Same here, with french translation. Sorry for the late reply. -- Guillaume _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-21 12:29 ` Fabio Riga 2009-10-21 16:41 ` Guillaume Quintard @ 2009-10-21 18:37 ` Christopher Bertels 1 sibling, 0 replies; 29+ messages in thread From: Christopher Bertels @ 2009-10-21 18:37 UTC (permalink / raw) To: sup-talk [-- Attachment #1.1: Type: text/plain, Size: 1179 bytes --] Excerpts from Fabio Riga's message of Mi Okt 21 14:29:59 +0200 2009: > Well, I'm really interested, but I'm just a user. I could only make > Italian translation, but how? Is it a normal gettext .po file? What I > have to do? Get my sup clone git repository at gitorious: $ git clone git://gitorious.org/~bakkdoor/sup/bakkdoors-clone.git Then, checkout the i18n branch. $ cd bakkdoors-clone $ git checkout i18n Then have a look at the m17n folder. You should find a de.yaml and en.yaml file. They are for german and english translations. You can create your own translation files in there. For example, fr.yaml for french or it.yaml for italian. Have a look at en.yaml to see, what the original texts are (in english) and come up with your own translation. That's basically it. Then, if you have sup set up to run from that branch, you can set within your sup config file (~/.sup/config.yaml) to use any language, e.g.: :language: de for german. Sup will then look into the m17n folder for a file called "de.yaml" I hope that helped. Cheers, Christopher. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 140 bytes --] _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-02 12:52 ` Christopher Bertels 2009-10-05 16:00 ` Christopher Bertels @ 2009-10-23 7:00 ` Tero Tilus 2009-10-23 11:23 ` Fabio Riga 2009-11-02 12:13 ` William Morgan 1 sibling, 2 replies; 29+ messages in thread From: Tero Tilus @ 2009-10-23 7:00 UTC (permalink / raw) To: sup-talk Excerpts from 's message of pe loka 02 15:52:47 +0300 2009: > Please tell me what you think. Why not default to the english strings as translation keys and fallback to key itself in case of missing translation? This has imo several advantages. You can go grep the source using what you see in sup UI (instead of first greping language yaml). Adding new strings is cumbersome with (mostly unnecessary) key indirection. Code is more readable when messages are inlined. If you change a string a check of translations is forced (there is no translation for the changed version). Most translation workflow tools expect this kind of behavior. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-23 7:00 ` Tero Tilus @ 2009-10-23 11:23 ` Fabio Riga 2009-11-02 12:12 ` William Morgan 2009-11-02 12:13 ` William Morgan 1 sibling, 1 reply; 29+ messages in thread From: Fabio Riga @ 2009-10-23 11:23 UTC (permalink / raw) To: sup-talk Excerpts from Tero Tilus's message of ven ott 23 09:00:21 +0200 2009: > Excerpts from 's message of pe loka 02 15:52:47 +0300 2009: > > Please tell me what you think. > > Why not default to the english strings as translation keys and > fallback to key itself in case of missing translation? This has imo > several advantages. You can go grep the source using what you see in > sup UI (instead of first greping language yaml). Well, I finally read the code and I agree with Tero. I also think that the use of gettext will be simpler for both developer and translator. In this way, every time a developer add a new string he need to write it twice, or another developer has to hack it. Instead with gettext the developer write his string, surrounded with _() or n_() and he's done (tell me, if I'm wrong). Furthermore people used to .po files (like me) will know what to do and are already provided with tools for that purpose (i.e. Vim :-) ). Can anyone explain me where and why a translated string in the UI should be searchable with a regular expression? (Maybe this question is due to the fact that I still don't understand sup internals...) Cheers, Fabio _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-23 11:23 ` Fabio Riga @ 2009-11-02 12:12 ` William Morgan 2009-11-02 13:58 ` Tero Tilus 0 siblings, 1 reply; 29+ messages in thread From: William Morgan @ 2009-11-02 12:12 UTC (permalink / raw) To: sup-talk Reformatted excerpts from Fabio Riga's message of 2009-10-23: > Well, I finally read the code and I agree with Tero. I also think that > the use of gettext will be simpler for both developer and translator. > In this way, every time a developer add a new string he need to write > it twice, or another developer has to hack it. Instead with gettext > the developer write his string, surrounded with _() or n_() and he's > done (tell me, if I'm wrong). Tero's comment wasn't about gettext, as far as I understand it. There are Ruby gettext bindings but they look like a pain in the ass to use, and it's pretty trivial to replace it a language like Ruby. > Furthermore people used to .po files (like me) will know what to do > and are already provided with tools for that purpose (i.e. Vim :-) ). That is a downside, definitely. > Can anyone explain me where and why a translated string in the UI should be > searchable with a regular expression? (Maybe this question is due to the > fact that I still don't understand sup internals...) I believe he was thinking about something like git grep. You see a weird message displayed by Sup, you want to find the code that's generating it, you can git grep the source for the message directly. -- William <wmorgan-sup@masanjin.net> _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-02 12:12 ` William Morgan @ 2009-11-02 13:58 ` Tero Tilus 2009-11-02 14:59 ` William Morgan 2009-11-03 0:01 ` Fabio Riga 0 siblings, 2 replies; 29+ messages in thread From: Tero Tilus @ 2009-11-02 13:58 UTC (permalink / raw) To: sup-talk William Morgan, 2009-11-02 14:12: > Reformatted excerpts from Fabio Riga's message of 2009-10-23: >> Well, I finally read the code and I agree with Tero. I also think that >> the use of gettext will be simpler for both developer and translator. > > Tero's comment wasn't about gettext, as far as I understand it. You had me right. I was talking about the approach to i18n in general. > There are Ruby gettext bindings but they look like a pain in the ass > to use, and it's pretty trivial to replace it a language like Ruby. Also they are pretty trivial to wrap behind nice interface in a language like Ruby. "Been there, done that!".t :) >> Can anyone explain me where and why a translated string in the UI >> should be searchable with a regular expression? > > I believe he was thinking about something like git grep. You see a > weird message displayed by Sup, you want to find the code that's > generating it, you can git grep the source for the message directly. That was exactly what I was thinking. Having weird keys in code imo also slows down development. If I want to (write code to) display a simple message to user, with "original language as key" approac i just write "my message".t (or whatever the l10n interface is) instead of modifying some yaml file somewhere and then copy-pasting the key from there to code. I just plain code and let somebody else figure out the translation later or. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-02 13:58 ` Tero Tilus @ 2009-11-02 14:59 ` William Morgan 2009-11-03 0:01 ` Fabio Riga 1 sibling, 0 replies; 29+ messages in thread From: William Morgan @ 2009-11-02 14:59 UTC (permalink / raw) To: sup-talk Reformatted excerpts from Tero Tilus's message of 2009-11-02: > Having weird keys in code imo also slows down development. If I want > to (write code to) display a simple message to user, with "original > language as key" approac i just write "my message".t (or whatever the > l10n interface is) instead of modifying some yaml file somewhere and > then copy-pasting the key from there to code. I just plain code and > let somebody else figure out the translation later or. I tend to agree. -- William <wmorgan-sup@masanjin.net> _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-02 13:58 ` Tero Tilus 2009-11-02 14:59 ` William Morgan @ 2009-11-03 0:01 ` Fabio Riga 2009-11-03 1:22 ` Tero Tilus 1 sibling, 1 reply; 29+ messages in thread From: Fabio Riga @ 2009-11-03 0:01 UTC (permalink / raw) To: sup-talk Excerpts from Tero Tilus's message of lun nov 02 14:58:09 +0100 2009: > William Morgan, 2009-11-02 14:12: > > Tero's comment wasn't about gettext, as far as I understand it. > > You had me right. I was talking about the approach to i18n in general. Sorry, I think the problem here is my English. I understood Tero's comment wasn't about gettext, I was the one suggesting: "everybody's using gettext, why don't we?" > > There are Ruby gettext bindings but they look like a pain in the ass > > to use, and it's pretty trivial to replace it a language like Ruby. > > Also they are pretty trivial to wrap behind nice interface in a > language like Ruby. "Been there, done that!".t :) And you both answered that question... I'm just a hobbyist ruby programmer, never used gettext. I transleted a program that use it (my previous mail client :D) so I can read a .po file (I don't understand why this is a problem, though). I thought it was an easy, ready-made thing to implement, if I'm wrong, no problem, there is always a better solution. > > I believe he was thinking about something like git grep. You see a > > weird message displayed by Sup, you want to find the code that's > > generating it, you can git grep the source for the message directly. > > That was exactly what I was thinking. > > Having weird keys in code imo also slows down development. If I want > to (write code to) display a simple message to user, with "original > language as key" approac i just write "my message".t (or whatever the > l10n interface is) instead of modifying some yaml file somewhere and > then copy-pasting the key from there to code. I just plain code and > let somebody else figure out the translation later or. > Sorry, I don't understand what you mean. The idea is to (1) have a branch for every language? Translators directly write in the code? Or (2) "original language as key" means a way to substitute "on the fly" the original string with another one in the current locale? In this way you always need a yaml file, or a ruby hash, or a .po file (you can implement it in another way, but is the gettext approach...). So, I played a little with irb... do you mean something like: class String def t l10n_hash[self] || self end end Sounds good to me... "bye bye".t => "ciao ciao" _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-03 0:01 ` Fabio Riga @ 2009-11-03 1:22 ` Tero Tilus 0 siblings, 0 replies; 29+ messages in thread From: Tero Tilus @ 2009-11-03 1:22 UTC (permalink / raw) To: sup-talk Fabio Riga, 2009-11-03 02:01: > Sorry, I don't understand what you mean. The idea is to (1) have a > branch for every language? Translators directly write in the code? > Or (2) "original language as key" means a way to substitute "on the > fly" the original string with another one in the current locale? The second one, yes. God save us from the first! > So, I played a little with irb... do you mean something like: > > class String > def t > l10n_hash[self] || self > end > end Exactly. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-10-23 7:00 ` Tero Tilus 2009-10-23 11:23 ` Fabio Riga @ 2009-11-02 12:13 ` William Morgan 2009-11-03 14:05 ` Christopher Bertels 1 sibling, 1 reply; 29+ messages in thread From: William Morgan @ 2009-11-02 12:13 UTC (permalink / raw) To: sup-talk Reformatted excerpts from Tero Tilus's message of 2009-10-23: > Why not default to the english strings as translation keys and > fallback to key itself in case of missing translation? Christopher, what do you think? -- William <wmorgan-sup@masanjin.net> _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-02 12:13 ` William Morgan @ 2009-11-03 14:05 ` Christopher Bertels 2009-11-03 15:08 ` Tero Tilus 0 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-11-03 14:05 UTC (permalink / raw) To: sup-talk [-- Attachment #1.1: Type: text/plain, Size: 648 bytes --] Excerpts from William Morgan's message of Mo Nov 02 13:13:01 +0100 2009: > Reformatted excerpts from Tero Tilus's message of 2009-10-23: > > Why not default to the english strings as translation keys and > > fallback to key itself in case of missing translation? > > Christopher, what do you think? Sounds OK to me. Should we use gettext then or rely on .yaml files for any additional translations then? I haven't used gettext yet and from what I remember it lookes weird, at least the ruby binding did. Maybe it's very easy though. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 140 bytes --] _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-03 14:05 ` Christopher Bertels @ 2009-11-03 15:08 ` Tero Tilus 2009-11-03 15:13 ` William Morgan 0 siblings, 1 reply; 29+ messages in thread From: Tero Tilus @ 2009-11-03 15:08 UTC (permalink / raw) To: sup-talk Christopher Bertels, 2009-11-03 16:05: > Should we use gettext then or rely on .yaml files for any additional > translations then? I haven't used gettext yet and from what I > remember it lookes weird, at least the ruby binding did. Maybe it's > very easy though. The l10n backend is an implementation detail. If we really need to we can change backend later down the road if it is decoupled enough from the i18n of sup itself. IMO you get to choose what we start with. And William gets to choose if he accepts the patches or not. ;) -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-03 15:08 ` Tero Tilus @ 2009-11-03 15:13 ` William Morgan 2009-11-03 15:23 ` Christopher Bertels 0 siblings, 1 reply; 29+ messages in thread From: William Morgan @ 2009-11-03 15:13 UTC (permalink / raw) To: sup-talk Reformatted excerpts from Tero Tilus's message of 2009-11-03: > IMO you get to choose what we start with. Yeah, Christopher has a working implementation of this already using yaml, and I'm happy to merge it if he changes the keys to strings as discussed. -- William <wmorgan-sup@masanjin.net> _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [sup-talk] i18n? 2009-11-03 15:13 ` William Morgan @ 2009-11-03 15:23 ` Christopher Bertels 0 siblings, 0 replies; 29+ messages in thread From: Christopher Bertels @ 2009-11-03 15:23 UTC (permalink / raw) To: sup-talk [-- Attachment #1.1: Type: text/plain, Size: 519 bytes --] Excerpts from William Morgan's message of Di Nov 03 16:13:10 +0100 2009: > Reformatted excerpts from Tero Tilus's message of 2009-11-03: > > IMO you get to choose what we start with. > > Yeah, Christopher has a working implementation of this already using > yaml, and I'm happy to merge it if he changes the keys to strings as > discussed. Alright, I'll change that then and tell you here when I'm done. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 902 bytes --] [-- Attachment #2: Type: text/plain, Size: 140 bytes --] _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 16:44 ` William Morgan 2009-10-01 18:15 ` Christopher Bertels @ 2009-10-01 18:21 ` Christopher Bertels 2009-10-01 18:33 ` Christopher Bertels 2 siblings, 0 replies; 29+ messages in thread From: Christopher Bertels @ 2009-10-01 18:21 UTC (permalink / raw) Excerpts from William Morgan's message of Do Okt 01 18:44:43 +0200 2009: > I have no immediate plans personally, but I would love to have this in > Sup. Ok, great! > There is a Ruby-Gettext package, which we already use for other reasons. > I think this is probably the best thing to start with, unless it turns > out to be too hard to use, in which case we could consider a custom > solution. > > http://www.yotabanana.com/hiki/ruby-gettext.html Thanks, I'll have a look at it. Btw, another reason for adding something like this would be that sup depends on an english version of gpg. For checking a trust-path, for example, it uses a regular expression that checks for a certain output of gpg (in english). Since I have a german version, this obviously doesn't work (I had to patch it for my needs). I guess there probably are more things where different languages could play a role, so putting it in a central, well-defined location makes sense. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 16:44 ` William Morgan 2009-10-01 18:15 ` Christopher Bertels 2009-10-01 18:21 ` Christopher Bertels @ 2009-10-01 18:33 ` Christopher Bertels 2009-10-01 18:47 ` Rich Lane 2 siblings, 1 reply; 29+ messages in thread From: Christopher Bertels @ 2009-10-01 18:33 UTC (permalink / raw) Please excuse my double posting. Sup crashed after sending a message. I have the exception log attached. Seems like it has a problem with the sent.mbox and wants me to sup-sync --changed sup://sent I switched from ferret to xapian today and the error clearly happens there. -- ================================ Christopher Bertels http://www.adztec-independent.de GPG Key ID: 0x2345b203 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: exception-log.txt URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20091001/8366e0e9/attachment.txt> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [sup-talk] i18n? 2009-10-01 18:33 ` Christopher Bertels @ 2009-10-01 18:47 ` Rich Lane 0 siblings, 0 replies; 29+ messages in thread From: Rich Lane @ 2009-10-01 18:47 UTC (permalink / raw) Excerpts from Christopher Bertels's message of Thu Oct 01 14:33:03 -0400 2009: > undefined method `[]' for nil:NilClass > /home/bakkdoor/projekte/ruby/sup/lib/sup/xapian_index.rb:558:in `mkterm' What commit is your tree at? ^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2009-11-03 16:26 UTC | newest] Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-09-30 23:30 [sup-talk] i18n? Christopher Bertels 2009-10-01 16:44 ` William Morgan 2009-10-01 18:15 ` Christopher Bertels 2009-10-01 18:24 ` William Morgan 2009-10-02 0:19 ` Christopher Bertels 2009-10-02 12:52 ` Christopher Bertels 2009-10-05 16:00 ` Christopher Bertels 2009-10-06 15:38 ` William Morgan 2009-10-06 20:35 ` Christopher Bertels 2009-10-06 21:56 ` Christopher Bertels 2009-10-20 12:33 ` Christopher Bertels 2009-10-21 12:29 ` Fabio Riga 2009-10-21 16:41 ` Guillaume Quintard 2009-10-21 18:37 ` Christopher Bertels 2009-10-23 7:00 ` Tero Tilus 2009-10-23 11:23 ` Fabio Riga 2009-11-02 12:12 ` William Morgan 2009-11-02 13:58 ` Tero Tilus 2009-11-02 14:59 ` William Morgan 2009-11-03 0:01 ` Fabio Riga 2009-11-03 1:22 ` Tero Tilus 2009-11-02 12:13 ` William Morgan 2009-11-03 14:05 ` Christopher Bertels 2009-11-03 15:08 ` Tero Tilus 2009-11-03 15:13 ` William Morgan 2009-11-03 15:23 ` Christopher Bertels 2009-10-01 18:21 ` Christopher Bertels 2009-10-01 18:33 ` Christopher Bertels 2009-10-01 18:47 ` Rich Lane
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox