[symfony-users] Re: i18n with technical names instead of text
You can simply user: _('mainPage.linkToLogin' ) in your code. But if you want to be more explicit about non translated strings (warn users about non translated strings), why can't use prefix/suffix as we can see in docs: http://www.symfony-project.org/reference/1_4/en/05-Factories#chapter_05_i18n []'s Rafael Goulart from Brazil On 30 abr, 06:27, Daniel Kucharski dan...@inspiran.be wrote: Hi, Is it possible to use technical names such as 'loginForm.sendButton' or 'mainPage.linkToLogin' instead of the actual text for the default culture in any view template and have it translated through I18n based upon the culture? Kind regards, Daniel -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: i18n with technical names instead of text
I've been thinking about using 'keys' instead of full sentences: echo __('layout.greeting'); But is this an acceptable/symfony way to do it? On Fri, Apr 30, 2010 at 10:45 AM, rafaelgou rafael...@gmail.com wrote: You can simply user: _('mainPage.linkToLogin' ) in your code. But if you want to be more explicit about non translated strings (warn users about non translated strings), why can't use prefix/suffix as we can see in docs: http://www.symfony-project.org/reference/1_4/en/05-Factories#chapter_05_i18n []'s Rafael Goulart from Brazil On 30 abr, 06:27, Daniel Kucharski dan...@inspiran.be wrote: Hi, Is it possible to use technical names such as 'loginForm.sendButton' or 'mainPage.linkToLogin' instead of the actual text for the default culture in any view template and have it translated through I18n based upon the culture? Kind regards, Daniel -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: i18n with technical names instead of text
On Apr 30, 7:37 pm, Tom Haskins-Vaughan t...@templestreetmedia.com wrote: I've been thinking about using 'keys' instead of full sentences: echo __('layout.greeting'); But is this an acceptable/symfony way to do it? Symfony won't tell you off if you do, it's up to you. There are pros and cons really... The biggest con is that you have no fallback translation, so you may find someone looking at some language with homepage.welcomemessage instead of the default which you would probably have written in English. This means you also have to create an English trenslation, which you wouldn't have to do if your base strings were English in the first place. Another potential downside is with reusability. Depending on your implementation you may have loginform.submitbutton and registrationform.submitbutton which will take up two spaces in your translation file whereas otherwise they both would have been covered by __(Submit). This has a customisation advantage (which you could also use catalogues for), but a reusability disadvantage, so it's really down to your architecture. Just weigh it up and do what fits best for your needs - it's not a best practice issue in my opinion, just a design decision. Russ. On Fri, Apr 30, 2010 at 10:45 AM, rafaelgou rafael...@gmail.com wrote: You can simply user: _('mainPage.linkToLogin' ) in your code. But if you want to be more explicit about non translated strings (warn users about non translated strings), why can't use prefix/suffix as we can see in docs: http://www.symfony-project.org/reference/1_4/en/05-Factories#chapter_... []'s Rafael Goulart from Brazil On 30 abr, 06:27, Daniel Kucharski dan...@inspiran.be wrote: Hi, Is it possible to use technical names such as 'loginForm.sendButton' or 'mainPage.linkToLogin' instead of the actual text for the default culture in any view template and have it translated through I18n based upon the culture? Kind regards, Daniel -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en- Hide quoted text - - Show quoted text - -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: i18n with technical names instead of text
Thanks for your input, Russ. I haven't used i18n much but I've taken over a CI project that uses keys rather than full sentences. I guess the benefit I was looking at is maintenance of the dictionaries, but I'll bear your advice in mind. Tom On Fri, Apr 30, 2010 at 1:48 PM, rooster (Russ) russmon...@gmail.com wrote: On Apr 30, 7:37 pm, Tom Haskins-Vaughan t...@templestreetmedia.com wrote: I've been thinking about using 'keys' instead of full sentences: echo __('layout.greeting'); But is this an acceptable/symfony way to do it? Symfony won't tell you off if you do, it's up to you. There are pros and cons really... The biggest con is that you have no fallback translation, so you may find someone looking at some language with homepage.welcomemessage instead of the default which you would probably have written in English. This means you also have to create an English trenslation, which you wouldn't have to do if your base strings were English in the first place. Another potential downside is with reusability. Depending on your implementation you may have loginform.submitbutton and registrationform.submitbutton which will take up two spaces in your translation file whereas otherwise they both would have been covered by __(Submit). This has a customisation advantage (which you could also use catalogues for), but a reusability disadvantage, so it's really down to your architecture. Just weigh it up and do what fits best for your needs - it's not a best practice issue in my opinion, just a design decision. Russ. On Fri, Apr 30, 2010 at 10:45 AM, rafaelgou rafael...@gmail.com wrote: You can simply user: _('mainPage.linkToLogin' ) in your code. But if you want to be more explicit about non translated strings (warn users about non translated strings), why can't use prefix/suffix as we can see in docs: http://www.symfony-project.org/reference/1_4/en/05-Factories#chapter_... []'s Rafael Goulart from Brazil On 30 abr, 06:27, Daniel Kucharski dan...@inspiran.be wrote: Hi, Is it possible to use technical names such as 'loginForm.sendButton' or 'mainPage.linkToLogin' instead of the actual text for the default culture in any view template and have it translated through I18n based upon the culture? Kind regards, Daniel -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en- Hide quoted text - - Show quoted text - -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en