[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12360960 ] helena commented on FOR-506: The catalogue file can it support mutliple languages or one cat file per language: catalogues catalogue message key=/message /catalogue catalogue xml:lang=locale message key=key/message /catalogue I am not clear on the xml:lang=locale attribute catalogue xml:lang=locale message key=keytext ior/i markup/message /catalogue or how one might make each catalogue unique or the value of locale the latest diff file for sitemap changes, there's no opening serialize tag, it seems most of the entires have some funky nesting - missing opening tags/closing tags. Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7 Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: frenchMessages.diff, newFrenchMessages.diff, patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12360964 ] helena commented on FOR-506: Excuse my initial comment - slopy wording. In the patchI18n.diff file, the nesting is not clear: map:generator name=text2xml logger=sitemap.generator.textgenerator src=org.apache.cocoon.generation.TextGenerator parameter name=localizable value=true/ /map:generator /map:generator /map:generators map:transformers default=xslt parameter name=recovery value=true/ parameter name=localizable value=true/ /map:transformer map:transformer name=i18n src=org.apache.cocoon.transformation.I18nTransformer catalogues default=common catalogue id=common name=CommonMessages location=skins/common/messages/ /catalogues cache-at-startuptrue/cache-at-startup /map:transformer /map:transformers map:readers default=resource map:reader name=resource src=org.apache.cocoon.reading.ResourceReader/ /map:transform /map:otherwise /map:select map:transform type=i18n map:parameter name=locale value={request:locale}/ !--map:parameter name=locale value=es-ES/-- /map:transform map:serialize/ /map:resource Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7 Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: frenchMessages.diff, newFrenchMessages.diff, patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12317756 ] David Crossley commented on FOR-506: Some html validation issues ... Re: FOR-592 - pelt and i18n clarifications http://marc.theaimsgroup.com/?t=11231601642 Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7 Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: frenchMessages.diff, newFrenchMessages.diff, patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12313425 ] David Crossley commented on FOR-506: Thanks, would you please do an 'svn update' and verify that the accented character is okay. Subversion reported conflicts for other reasons, so i applied it by hand. Also i tweaked it to be consistent with the others. I we change the colon spacing, we should be consistent. You might need to do 'svn revert CommonMessages_fr.xml' before you update. Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: frenchMessages.diff, newFrenchMessages.diff, patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Cordialement, Cyriaque, David Crossley (JIRA) a crit : [ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12313425 ] David Crossley commented on FOR-506: Thanks, would you please do an 'svn update' and verify that the accented character is okay. It's Okay, Subversion reported conflicts for other reasons, so i applied it by hand. Also i tweaked it to be consistent with the others. I we change the colon spacing, we should be consistent. In French we have to put one blanc before and one blanc after the semi-colon ;, the colon :, the question mark ? and the exclamation mark !... http://grammaire.reverso.net/index_alpha/Fiches/Fiche193.htm That's why I did not do as the others ;-) . You might need to do 'svn revert CommonMessages_fr.xml' before you update. I effectively had to resolve a conflict..; Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: frenchMessages.diff, newFrenchMessages.diff, patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use.
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Cyriaque Dupoirieux wrote: David Crossley wrote: Thanks, would you please do an 'svn update' and verify that the accented character is okay. It's Okay, Subversion reported conflicts for other reasons, so i applied it by hand. Also i tweaked it to be consistent with the others. I we change the colon spacing, we should be consistent. In French we have to put one blanc before and one blanc after the semi-colon ;, the colon :, the question mark ? and the exclamation mark !... http://grammaire.reverso.net/index_alpha/Fiches/Fiche193.htm That's why I did not do as the others ;-) . Okay i will put it back. You might need to do 'svn revert CommonMessages_fr.xml' before you update. I effectively had to resolve a conflict..; That is why i suggested that you copy your file to a save. Then either remove your copy or do 'svn revert'. Then do 'svn update'. --David
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Pedro I. Sanchez wrote: I can not reproduce this. Forrest site works for me. Are you on Linux or Windows? debian 3.1 I don't understand. How can it work for you? how can it does not work for you? This line in sitemap.xmap is the one that determines the catalogue to use and as you can see it is not connected at all with the LANG environment variable. no, I do not see why are you making this up. map:parameter name=locale value={request:locale}/ It is connected instead to the language selection of your browser which doesn't help much with a static site. Why are you making that statement without knowledge of how it works? Locale is determined based on diferent parameters with an order, not just that one. have you try to issue export LANG=es ??? I think that I told you before. It's the same. In both cases the execution environment has the variable LANG set to the proper value. Anyhow, I tested using the export with the same results. Can you explain why you think 'user.language' does anything when it is not defined in forrest.build.xml? Because is part of the JVM properties and it will define the server default language use. So when you try to build a static site the VM default locale is used. Possibly we need to look into the CLI to find out a better way to do that, ok, but today that know this can work. I made some notes here: http://casa.che-che.com/blog/2005/05/10/internalization-a-site-using-forrest-07-dev/ if that does not work for you then it is something that is not quite right on your enviroment/test Cheers, cheche
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Pedro I. Sanchez wrote: The string $(env.LANG} works well inside main/forrest.build.xml. It was the default before you made changes to the trunk. But the same string is ignored when you use it inside webapp/sitemap.xmap (skin labels are looked up in the English dictionary, even if LANG=es_ES). are you talking about tabs and menus or are you talking about Last Published: I don't believe what you did is right, sorry if I misunderstand :| You replaced my 'project.language' with 'user.language' but you are not defining 'user.language' in forrest.build.xml. So it does nothing when I use it in my site's 'forrest.properties'. is using the default language for the JVM. In the case of the windows machines, that will work much better. This change only affect the creation of a directory base on the language.. This way you can run export LANG=en forrest site export LANG=es forrest site so diferent languages goes to diferent directories. So, let me rephrase my understanding of this issue so far. Before you made changes to trunk this was the behaviour: 1. Forrest seed; forrest would generate the static site in English, regardless of your LANG env. sure. There is not implementation to seed a project with examples in spanish.. 2. Setting project.i18n=true in forrest.properties and running forrest again would generate your site in build/site/xx, where xx is determined by the LANG env. BUT, the generated static site is still all in English; no look up into the language-specific catalogues ever takes place. I can not reproduce this. Forrest site works for me. My goal for a static site is to be able to issue the command $ LANG=es_ES forrest have you try to issue export LANG=es ??? I think that I told you before. cheers, cheche
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Thu, 2005-09-06 at 12:56 +0200, Juan Jose Pablos wrote: Pedro I. Sanchez wrote: The string $(env.LANG} works well inside main/forrest.build.xml. It was the default before you made changes to the trunk. But the same string is ignored when you use it inside webapp/sitemap.xmap (skin labels are looked up in the English dictionary, even if LANG=es_ES). are you talking about tabs and menus or are you talking about Last Published: Last Published: I don't believe what you did is right, sorry if I misunderstand :| You replaced my 'project.language' with 'user.language' but you are not defining 'user.language' in forrest.build.xml. So it does nothing when I use it in my site's 'forrest.properties'. is using the default language for the JVM. In the case of the windows machines, that will work much better. This change only affect the creation of a directory base on the language.. This way you can run export LANG=en forrest site export LANG=es forrest site so diferent languages goes to diferent directories. As I said that used to work before your changes; it doesn't work now for me. You removed the reference to $(env.LANG} in favour of user.language (which I believe is doing nothing). Before: location=${project.build-dir}/site/${env.LANG} With your changes: location=${project.build-dir}/site/${user.language} So, let me rephrase my understanding of this issue so far. Before you made changes to trunk this was the behaviour: 1. Forrest seed; forrest would generate the static site in English, regardless of your LANG env. sure. There is not implementation to seed a project with examples in spanish.. 2. Setting project.i18n=true in forrest.properties and running forrest again would generate your site in build/site/xx, where xx is determined by the LANG env. BUT, the generated static site is still all in English; no look up into the language-specific catalogues ever takes place. I can not reproduce this. Forrest site works for me. Are you on Linux or Windows? I don't understand. How can it work for you? This line in sitemap.xmap is the one that determines the catalogue to use and as you can see it is not connected at all with the LANG environment variable. map:parameter name=locale value={request:locale}/ It is connected instead to the language selection of your browser which doesn't help much with a static site. My goal for a static site is to be able to issue the command $ LANG=es_ES forrest have you try to issue export LANG=es ??? I think that I told you before. It's the same. In both cases the execution environment has the variable LANG set to the proper value. Anyhow, I tested using the export with the same results. Can you explain why you think 'user.language' does anything when it is not defined in forrest.build.xml? -- Pedro
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Wed, 2005-01-06 at 12:02 +0200, Juan Jose Pablos wrote: Pedro I. Sanchez wrote: Anyway, first I verified that setting value=es_ES in main/webapp/sitemap.xmap indeed works. It brings the Spanish strings from the right catalogue. I also verified that value=${env.LANG} does *not* work. are you sure that the $LANG property is set on your system? if not do an export LANG=es_ES do an echo $LANG before running forrest site to verify that the change has been made. The string $(env.LANG} works well inside main/forrest.build.xml. It was the default before you made changes to the trunk. But the same string is ignored when you use it inside webapp/sitemap.xmap (skin labels are looked up in the English dictionary, even if LANG=es_ES). 1) First change -#project.i18n=true +project.i18n=true +project.language=es_ES And this alone works just well. The site is generated under build/site/es_ES but with English labels. The next step is required to get the translations in place. The i18naction does not know anything about project.language that is why it does not translate That's what I was trying to figure out in my 'second change'. 2) Second change: Reflecting these changes in the sitemap Unfortunately these gives me a null pointer and dies :( But there's tons of {project:} strings used everywhere in the site map! So, what's missing to make my newly created language property to work? forrest.build.xml likes it but sitemap.xmap doesn't. Well you change the new stuff about a skin i18n aware. There is more stuff that needs to change. Still, I think that the main issue that you have is that forrest does not get you env.LANG property. forrest.build.xml does. sitemap.xmap doesn't. I have change that so it uses {user.language} instead. try to svn up and report if that is working for you. I don't believe what you did is right, sorry if I misunderstand :| You replaced my 'project.language' with 'user.language' but you are not defining 'user.language' in forrest.build.xml. So it does nothing when I use it in my site's 'forrest.properties'. So, let me rephrase my understanding of this issue so far. Before you made changes to trunk this was the behaviour: 1. Forrest seed; forrest would generate the static site in English, regardless of your LANG env. 2. Setting project.i18n=true in forrest.properties and running forrest again would generate your site in build/site/xx, where xx is determined by the LANG env. BUT, the generated static site is still all in English; no look up into the language-specific catalogues ever takes place. With your changes to the trunk this is the current behaviour: 1. As before. 2. Setting project.i18n=true in forrest.properties and running forrest again would generate your static site in build/site/en, regardless of your LANG env. This is not the expected behaviour. And the site is generated in English as before, no changes here. My goal for a static site is to be able to issue the command $ LANG=es_ES forrest and get two things: a) My site is built under build/site/es. This was OK before your changes. It's not the case anymore. b) Get the generated static site with Spanish skin labels. This was not happening before and it's not happening now. The reason? We still have the line map:parameter name=locale value={request:locale}/ in sitemap.xmap which makes the translation unaware of the LANG setting. Replacing it with map:parameter name=locale value=${env.LANG}/ doesn't work. Replacing it with map:parameter name=locale value={project.language}/ gives a NULL pointer somewhere. I have some ideas on the i18n behaviour I'd like to see when generating a static site which I'll share in a different e-mail. Cheers, -- Pedro
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312725 ] Cyriaque Dupoirieux commented on FOR-506: - Hi, If someone creates an empty CommonMessages_fr.xml, I'll send a french patch... Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312807 ] Thorsten Scherler commented on FOR-506: --- I just did a copy of the english one and renamed to _fr. BTW you could have done that yourself by: cp CommonMessages_us.xml CommonMessages_fr.xml svn add CommonMessages_fr.xml svn diff i18n_fr.diff HTH ;-) Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sun, 2005-05-06 at 14:04 +0200, Thorsten Scherler wrote: This is key for me. If I cannot specify the language when I run forrest to build my site then this is not a good solution. I guess the other option would be to hard-code value=es_ES in the above. At least this would be just one thing hard coded :| Yeah that would solve your usecase, but in the future that should be done like you suggested in your former mail. LANG=de_DE forrest Any thoughts, how? I've been playing a little bit with this, and I mean playing indeed. Basically trial and error since I'm not familiar with the Cocoon machinery at all. Anyway, first I verified that setting value=es_ES in main/webapp/sitemap.xmap indeed works. It brings the Spanish strings from the right catalogue. I also verified that value=${env.LANG} does *not* work. It then occurred to me that I should be able to specify the locale string in the site's forrest.properties file. So I tested two changes: 1) First change Index: main/forrest.build.xml === --- main/forrest.build.xml (revision 180126) +++ main/forrest.build.xml (working copy) @@ -104,7 +104,8 @@ if equals arg1=${project.i18n} arg2=true/ then - property name=project.site-dir location=${project.build-dir}/site/${env.LANG}/ + property name=project.language location=${env.LANG} / + property name=project.site-dir location=${project.build-dir}/site/${project.language}/ /then else property name=project.site-dir location=${project.build-dir}/site/ In my site's forrest.properties I have to add -#project.i18n=true +project.i18n=true +project.language=es_ES And this alone works just well. The site is generated under build/site/es_ES but with English labels. The next step is required to get the translations in place. 2) Second change: Reflecting these changes in the sitemap Index: main/webapp/sitemap.xmap === --- main/webapp/sitemap.xmap(revision 180126) +++ main/webapp/sitemap.xmap(working copy) @@ -234,7 +234,7 @@ /map:otherwise /map:select map:transform type=i18n - map:parameter name=locale value={request:locale}/ + map:parameter name=locale value={project:language}/ /map:transform map:serialize/ /map:resource Unfortunately these gives me a null pointer and dies :( But there's tons of {project:} strings used everywhere in the site map! So, what's missing to make my newly created language property to work? forrest.build.xml likes it but sitemap.xmap doesn't. What is then the right way to define a new project property? -- Pedro
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sat, 2005-06-04 at 23:03 -0400, Pedro I. Sanchez wrote: On Sun, 2005-05-06 at 04:19 +0200, Thorsten Scherler wrote: On Sat, 2005-06-04 at 20:55 -0400, Pedro I. Sanchez wrote: snip/ My version of the Spanish messages would be the following: catalogue message key=Font size:Tamaño del texto:/message message key=Last Published:Fecha de publicación:/message message key=SearchBuscar/message message key=Search the site withBuscar en/message /catalogue Nice, can you prepare a patch and add it to this issue? I will apply it then, thx. I reckon there are more to come. ;-) Index: webapp/skins/common/messages/CommonMessages_es.xml === --- webapp/skins/common/messages/CommonMessages_es.xml (revision 180032) +++ webapp/skins/common/messages/CommonMessages_es.xml (working copy) @@ -15,8 +15,9 @@ limitations under the License. -- catalogue - message key=Font size:Tamaño de fuente:/message - message key=Last Published:Último publicado:/message - message key=SearchBúsqueda/message - message key=Search the site withBúsqueda en/message + message key=Font size:Tamaño del texto:/message + message key=Last Published:Fecha de publicación:/message + message key=SearchBuscar/message + message key=Search the site withBuscar en/message /catalogue + Patch applied to trunk. Now, how do i specify the desired language? The i18n doc talks about specifying the locale in the transform, I guess in a map file. Ideally it should be specified forrest.properties, or even better at the command line, like: $ LANG=de_DE forrest How is it done now? Actually I just tested it in 'forrest run' and not forrest. In the dynamic mode you can change the preferred language of your browser and hit refresh. In my experience, relying on the end user to select a language in his browser is never a good option. Most people don't even know they can do it. And you don't want your web pages to have to explain how to change the language option so that the pages can be read in a different language. Yeah you are right I guess we need some pics or a form to change the locals via the site. Patches welcome. ;-) I will have a look later. In my case, my short-time interest is to generate a site that will show up in Spanish only, and this regardless of the language option of the web browser. In real life most web sites are written in a single language and they show up as such regardless of the language settings in the web browsers. Right now you find in the main forrest sitemap.xmap: map:transform type=i18n map:parameter name=locale value={request:locale}/ /map:transform The question is how to parse the request:locale to the cli? ATM I do not know that, but I guess that is possible. ;-) This is key for me. If I cannot specify the language when I run forrest to build my site then this is not a good solution. I guess the other option would be to hard-code value=es_ES in the above. At least this would be just one thing hard coded :| Yeah that would solve your usecase, but in the future that should be done like you suggested in your former mail. LANG=de_DE forrest Any thoughts, how? One other comment: You are placing the catalogues under common/messages, which is probably fine for the default skin. But I believe that skins should come with their own catalogues because each can have an entirely different set of labels to be translated. Is this being accommodated by the skins plugin thing? Yes, this will go into views for now I added it to viewHelper.xhtml. There are some points I found out for a full i18n support for skins (view based). ...but this will be another thread. ;-) I reckon you have to extend the catalogues section like the following, but I have not test that. catalogues default=common catalogue id=common name=CommonMessages location=skins/common/messages/ catalogue id={forrest:skin} name={forrest:skin}Messages location=skins/{forrest:skin}/messages/ /catalogues Yes, I was thinking along these lines. Each skin has to have its own catalogue as an extension of a common catalogue that all skins can use. But I read something about a skins plugin in development and I was wondering how this plugin would automatically update this index of catalogues. Actually that needs discussion. Right now the catalogues are in forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/messages/ I am not sure what would be the best to automatically update this index of catalogues and whether this should be done by the plugin. For now we just add all messages of the contract there. ...but you are right we have to think how to mount as well project-specific catalogues. Any thoughts, how? salu2 -- thorsten Together we stand, divided we fall! Hey you (Pink
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Pedro I. Sanchez wrote: On Sun, 2005-05-06 at 04:19 +0200, Thorsten Scherler wrote: On Sat, 2005-06-04 at 20:55 -0400, Pedro I. Sanchez wrote: ... Nice, can you prepare a patch and add it to this issue? I will apply it then, thx. I reckon there are more to come. ;-) Index: webapp/skins/common/messages/CommonMessages_es.xml Pedro, thanks for your patch. Just a point to note, in future it is best to attach a patch to a related issue, that way it doesn't get lost in the archives. In this case Thorsten is on the ball so it doesn't matter, but imagine he had been called away for work. An email is easy to forget about, a patch isn't. Once again, thanks for highlighting this need, and for your contribution. Ross
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312633 ] Ross Gardler commented on FOR-506: -- When this issue is complete the FAQ How can I internationalise (i18n) my content? needs updating. Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sat, 2005-04-06 at 06:06 +0200, Thorsten Scherler (JIRA) wrote: [ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312612 ] Thorsten Scherler commented on FOR-506: --- The patch enables i18n support for forrest. Mainly it is focus right now on the i18n support for skins (in particular pelt). The changes I do not mention here are related to setup i18n support for the backend. The following code changes are as well the only example I implemented right now. ;-) Index: webapp/skins/pelt/xslt/html/site2xhtml.xsl === --- webapp/skins/pelt/xslt/html/site2xhtml.xsl(revision 179925) +++ webapp/skins/pelt/xslt/html/site2xhtml.xsl(working copy) @@ -34,7 +34,8 @@ -- -xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; +xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; + xmlns:i18n=http://apache.org/cocoon/i18n/2.1; xsl:import href=../../../common/xslt/html/site2xhtml.xsl/ !--+ @@ -687,7 +688,7 @@ xsl:template match=[EMAIL PROTECTED]'disable-font-script'] xsl:if test=$disable-font-script = 'false' div class=trail - Font size: + i18n:text Font size:/i18n:text You see I just surrounded the caption with a i18n:text / tag and added the key into the common messages. e.g. spanish translation: +catalogue + message key=Font size:Tamaño de fuente:/message +/catalogue or german: +catalogue + message key=Font size:Schriftgrösse:/message +/catalogue So what we need is that 1) we surround all captions with i18n:text / tags 2) add this keys to the catalogue Where is the catalogue where I need to add the keys/values to? -- Pedro
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
Pedro I. Sanchez wrote: On Sat, 2005-04-06 at 06:06 +0200, Thorsten Scherler (JIRA) wrote: [ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312612 ] Thorsten Scherler commented on FOR-506: --- ... So what we need is that 1) we surround all captions with i18n:text / tags 2) add this keys to the catalogue Where is the catalogue where I need to add the keys/values to? They are attached to the issue in the patch that Thorsten uploaded. Ross
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sat, 2005-04-06 at 23:49 +0200, Thorsten Scherler wrote: On Sat, 2005-06-04 at 21:36 +0100, Ross Gardler wrote: Pedro I. Sanchez wrote: On Sat, 2005-04-06 at 06:06 +0200, Thorsten Scherler (JIRA) wrote: [ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312612 ] Thorsten Scherler commented on FOR-506: --- ... So what we need is that 1) we surround all captions with i18n:text / tags 2) add this keys to the catalogue Where is the catalogue where I need to add the keys/values to? They are attached to the issue in the patch that Thorsten uploaded. Ross In revision 180026 I added (I applied the patch to trunk): main/webapp/skins/common/messages/CommonMessages_es.xml main/webapp/skins/common/messages/CommonMessages_de.xml main/webapp/skins/common/messages/CommonMessages_us.xml That are the catalogues. I guess the work should start in creating one master main/webapp/skins/common/messages/CommonMessages_us.xml and add all skin keys to it. Then cp main/webapp/skins/common/messages/CommonMessages_us.xml main/webapp/skins/common/messages/CommonMessages_{language_country_variant}.xml and translate the keys. HTH salu2 My version of the Spanish messages would be the following: catalogue message key=Font size:Tamaño del texto:/message message key=Last Published:Fecha de publicación:/message message key=SearchBuscar/message message key=Search the site withBuscar en/message /catalogue Now, how do i specify the desired language? The i18n doc talks about specifying the locale in the transform, I guess in a map file. Ideally it should be specified forrest.properties, or even better at the command line, like: $ LANG=de_DE forrest How is it done now? One other comment: You are placing the catalogues under common/messages, which is probably fine for the default skin. But I believe that skins should come with their own catalogues because each can have an entirely different set of labels to be translated. Is this being accommodated by the skins plugin thing? -- Pedro There's a couple of things
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sat, 2005-06-04 at 20:55 -0400, Pedro I. Sanchez wrote: snip/ My version of the Spanish messages would be the following: catalogue message key=Font size:Tamaño del texto:/message message key=Last Published:Fecha de publicación:/message message key=SearchBuscar/message message key=Search the site withBuscar en/message /catalogue Nice, can you prepare a patch and add it to this issue? I will apply it then, thx. I reckon there are more to come. ;-) Now, how do i specify the desired language? The i18n doc talks about specifying the locale in the transform, I guess in a map file. Ideally it should be specified forrest.properties, or even better at the command line, like: $ LANG=de_DE forrest How is it done now? Actually I just tested it in 'forrest run' and not forrest. In the dynamic mode you can change the preferred language of your browser and hit refresh. Right now you find in the main forrest sitemap.xmap: map:transform type=i18n map:parameter name=locale value={request:locale}/ /map:transform The question is how to parse the request:locale to the cli? ATM I do not know that, but I guess that is possible. ;-) One other comment: You are placing the catalogues under common/messages, which is probably fine for the default skin. But I believe that skins should come with their own catalogues because each can have an entirely different set of labels to be translated. Is this being accommodated by the skins plugin thing? Yes, this will go into views for now I added it to viewHelper.xhtml. There are some points I found out for a full i18n support for skins (view based). ...but this will be another thread. ;-) I reckon you have to extend the catalogues section like the following, but I have not test that. catalogues default=common catalogue id=common name=CommonMessages location=skins/common/messages/ catalogue id={forrest:skin} name={forrest:skin}Messages location=skins/{forrest:skin}/messages/ /catalogues salu2 -- thorsten Together we stand, divided we fall! Hey you (Pink Floyd)
Re: [jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
On Sun, 2005-05-06 at 04:19 +0200, Thorsten Scherler wrote: On Sat, 2005-06-04 at 20:55 -0400, Pedro I. Sanchez wrote: snip/ My version of the Spanish messages would be the following: catalogue message key=Font size:Tamaño del texto:/message message key=Last Published:Fecha de publicación:/message message key=SearchBuscar/message message key=Search the site withBuscar en/message /catalogue Nice, can you prepare a patch and add it to this issue? I will apply it then, thx. I reckon there are more to come. ;-) Index: webapp/skins/common/messages/CommonMessages_es.xml === --- webapp/skins/common/messages/CommonMessages_es.xml (revision 180032) +++ webapp/skins/common/messages/CommonMessages_es.xml (working copy) @@ -15,8 +15,9 @@ limitations under the License. -- catalogue - message key=Font size:Tamaño de fuente:/message - message key=Last Published:Último publicado:/message - message key=SearchBúsqueda/message - message key=Search the site withBúsqueda en/message + message key=Font size:Tamaño del texto:/message + message key=Last Published:Fecha de publicación:/message + message key=SearchBuscar/message + message key=Search the site withBuscar en/message /catalogue + Now, how do i specify the desired language? The i18n doc talks about specifying the locale in the transform, I guess in a map file. Ideally it should be specified forrest.properties, or even better at the command line, like: $ LANG=de_DE forrest How is it done now? Actually I just tested it in 'forrest run' and not forrest. In the dynamic mode you can change the preferred language of your browser and hit refresh. In my experience, relying on the end user to select a language in his browser is never a good option. Most people don't even know they can do it. And you don't want your web pages to have to explain how to change the language option so that the pages can be read in a different language. In my case, my short-time interest is to generate a site that will show up in Spanish only, and this regardless of the language option of the web browser. In real life most web sites are written in a single language and they show up as such regardless of the language settings in the web browsers. Right now you find in the main forrest sitemap.xmap: map:transform type=i18n map:parameter name=locale value={request:locale}/ /map:transform The question is how to parse the request:locale to the cli? ATM I do not know that, but I guess that is possible. ;-) This is key for me. If I cannot specify the language when I run forrest to build my site then this is not a good solution. I guess the other option would be to hard-code value=es_ES in the above. At least this would be just one thing hard coded :| One other comment: You are placing the catalogues under common/messages, which is probably fine for the default skin. But I believe that skins should come with their own catalogues because each can have an entirely different set of labels to be translated. Is this being accommodated by the skins plugin thing? Yes, this will go into views for now I added it to viewHelper.xhtml. There are some points I found out for a full i18n support for skins (view based). ...but this will be another thread. ;-) I reckon you have to extend the catalogues section like the following, but I have not test that. catalogues default=common catalogue id=common name=CommonMessages location=skins/common/messages/ catalogue id={forrest:skin} name={forrest:skin}Messages location=skins/{forrest:skin}/messages/ /catalogues Yes, I was thinking along these lines. Each skin has to have its own catalogue as an extension of a common catalogue that all skins can use. But I read something about a skins plugin in development and I was wondering how this plugin would automatically update this index of catalogues. -- Pedro salu2
[jira] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
[ http://issues.apache.org/jira/browse/FOR-506?page=comments#action_12312612 ] Thorsten Scherler commented on FOR-506: --- The patch enables i18n support for forrest. Mainly it is focus right now on the i18n support for skins (in particular pelt). The changes I do not mention here are related to setup i18n support for the backend. The following code changes are as well the only example I implemented right now. ;-) Index: webapp/skins/pelt/xslt/html/site2xhtml.xsl === --- webapp/skins/pelt/xslt/html/site2xhtml.xsl (revision 179925) +++ webapp/skins/pelt/xslt/html/site2xhtml.xsl (working copy) @@ -34,7 +34,8 @@ -- -xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; +xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; + xmlns:i18n=http://apache.org/cocoon/i18n/2.1; xsl:import href=../../../common/xslt/html/site2xhtml.xsl/ !--+ @@ -687,7 +688,7 @@ xsl:template match=[EMAIL PROTECTED]'disable-font-script'] xsl:if test=$disable-font-script = 'false' div class=trail - Font size: +i18n:text Font size:/i18n:text You see I just surrounded the caption with a i18n:text / tag and added the key into the common messages. e.g. spanish translation: +catalogue + message key=Font size:Tamao de fuente:/message +/catalogue or german: +catalogue + message key=Font size:Schriftgrsse:/message +/catalogue So what we need is that 1) we surround all captions with i18n:text / tags 2) add this keys to the catalogue I will prepare an example how to do it with @attributes. Do not hard-code site-visible message strings in skin files --- Key: FOR-506 URL: http://issues.apache.org/jira/browse/FOR-506 Project: Forrest Type: Improvement Components: Skins (general issues) Versions: 0.7-dev Environment: N/A Reporter: Pedro I. Sanchez Assignee: Thorsten Scherler Priority: Minor Attachments: patchI18n.diff Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
The following comment has been added to this issue: Author: Cyriaque Dupoirieux Created: Thu, 26 May 2005 11:12 AM Body: Excellent, but I don't think it's a minor problem. My own skin - originally based on pelt - is now far from the original one generally for translation reason. The ProjectInfo plugin has now the same limits and I also have my own copy of it... The configuration management begins to be complex for me when a file changes... - View this comment: http://issues.cocoondev.org//browse/FOR-506?page=comments#action_12430 - View the issue: http://issues.cocoondev.org//browse/FOR-506 Here is an overview of the issue: - Key: FOR-506 Summary: Do not hard-code site-visible message strings in skin files Type: Improvement Status: Unassigned Priority: Minor Project: Forrest Components: Skins (general issues) Versions: 0.7-dev Assignee: Reporter: Pedro I. Sanchez Created: Thu, 26 May 2005 10:49 AM Updated: Thu, 26 May 2005 11:12 AM Environment: N/A Description: Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. - JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.cocoondev.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
[JIRA] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
The following comment has been added to this issue: Author: Ross Gardler Created: Thu, 26 May 2005 11:50 AM Body: Can you describe what you think the problem would be with this propsed solution of extending skinconf.xml? For example: i18n lang=en token name=lastPublished value=Last Published/ token name=copyright value=Copyright/ /i18n i18n lang=?? token name=lastPublished value=???/ token name=copyright value=???/ /i18n This schema allows any token to be added, so customisation of skins would not be a problem. - View this comment: http://issues.cocoondev.org//browse/FOR-506?page=comments#action_12431 - View the issue: http://issues.cocoondev.org//browse/FOR-506 Here is an overview of the issue: - Key: FOR-506 Summary: Do not hard-code site-visible message strings in skin files Type: Improvement Status: Unassigned Priority: Minor Project: Forrest Components: Skins (general issues) Versions: 0.7-dev Assignee: Reporter: Pedro I. Sanchez Created: Thu, 26 May 2005 10:49 AM Updated: Thu, 26 May 2005 11:50 AM Environment: N/A Description: Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. - JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.cocoondev.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
[JIRA] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
The following comment has been added to this issue: Author: Pedro I. Sanchez Created: Thu, 26 May 2005 2:26 PM Body: Couple of comments: 1. It could work, but for me to test it I would like to get clarification on two things: a) How do you enable the i18n .. /i18n thing to work? I just put your code in my web site and Forrest complains with skinconf.xml:369:9: Element type i18n must be declared. skinconf.xml:370:50: Element type token must be declared. b) lang=en, what does it mean? If en refers to the system language in the host where the web developer is working (the locale setting) then this doesn't work. I am developing an all-Spanish web site while working in an all english host environment. 2. What about the non-tokenized strings like Search? - View this comment: http://issues.cocoondev.org//browse/FOR-506?page=comments#action_12433 - View the issue: http://issues.cocoondev.org//browse/FOR-506 Here is an overview of the issue: - Key: FOR-506 Summary: Do not hard-code site-visible message strings in skin files Type: Improvement Status: Unassigned Priority: Minor Project: Forrest Components: Skins (general issues) Versions: 0.7-dev Assignee: Reporter: Pedro I. Sanchez Created: Thu, 26 May 2005 10:49 AM Updated: Thu, 26 May 2005 2:26 PM Environment: N/A Description: Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. - JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.cocoondev.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
[JIRA] Commented: (FOR-506) Do not hard-code site-visible message strings in skin files
The following comment has been added to this issue: Author: Ross Gardler Created: Thu, 26 May 2005 2:48 PM Body: My question was to it was to Cyriaque who said your proposal was not sufficient. I was asking why and adding details to the proposal. But since you ask for more info here we go (if this becomes a desgn discussion we should move it to the dev list and then place a summary here). a) How do you enable the i18n .. /i18n thing to work? I just put your code in my web site and Forrest complains with... My example is intended to be a suggestion for how the DTD could be extended to support what you are requesting. It doesn't exist yet. b) lang=en, what does it mean? Forrest has some in development i18n features, this would be one of them. I'm not sure exactly how it works, but somehow Forrest must be told which language to server. This value would be used in the skinning process in order to select the correct language tokens. 2. What about the non-tokenized strings like Search? Currently none of the strings are tokenised. If we adopt this solution then we will need to tokenise them all. This is open source - can you help us since this is your itch? If you want to tackle this discuss it with us on the dev list, we can help by pointing you in the right direction. Otherwise you'll have to wait until a dev finds the time and inclination to implement this, or another solution. - View this comment: http://issues.cocoondev.org//browse/FOR-506?page=comments#action_12434 - View the issue: http://issues.cocoondev.org//browse/FOR-506 Here is an overview of the issue: - Key: FOR-506 Summary: Do not hard-code site-visible message strings in skin files Type: Improvement Status: Unassigned Priority: Minor Project: Forrest Components: Skins (general issues) Versions: 0.7-dev Assignee: Reporter: Pedro I. Sanchez Created: Thu, 26 May 2005 10:49 AM Updated: Thu, 26 May 2005 2:48 PM Environment: N/A Description: Text strings like Copyright, Published, and Search are hardcoded into skin files like site2xhtml.xsl. When creating web sites in languages other than English the web developer is forced to create local versions of these skin files with the appropriated translations. Instead, the DTD for the skinconf.xml should be improved to allow these translations to be specified in this file. This would make Forrest much easier to use. - JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.cocoondev.org//secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira