Committed a fix for this. A bit hacky, but works: First I normalize “nb”,”nn”,”nn-NO”,”nb-NO”,”no-NO” => “nb”, to get a match in the array of released languages. Next, before building the redirect URL, I convert “nb” => “no” to match site language. I changed Norwegian from “none” to “soft”, and now the redirect works. However, due to JS code duplication, I also had to edit no/index.html to prevent further redirect =>”nb” there :)
We definitely need to centralize some scripts and avoid code duplication. It looks like someone started a refactor of all this in index_test.html, but it was never completed. -- Jan Høydahl Search Solution architect Cominvent AS www.cominvent.com +47 90125809 > 21. apr. 2016 kl. 20.46 skrev Marcus <marcus.m...@wtnet.de>: > > Am 04/19/2016 01:07 PM, schrieb Jan Høydahl: >>> Should I start with "no-test" or should I go directly to your "no" files? >> >> I thought I’d give you a choice :-) >> The current no-test looks great, and the latest changes are minor, so I >> believe it is safe to go straight to /no. >> If you CC my janhoy@apache address after the change I’ll do a QA of the new >> live site asap to verify everything. > > I've committed and pubished now directly the new "no/" webpages. > > I took a quick check and for me it looks OK so far. But please test yourself. > ;-) > > Marcus > > > >>> 18. apr. 2016 kl. 23.19 skrev Marcus<marcus.m...@wtnet.de>: >>> >>> Am 04/18/2016 11:30 AM, schrieb Jan Høydahl: >>>> I have now translated the Download text on the front page, as well as >>>> fixed a few missing translations in product and why. >>>> Resulting tarball is here >>>> http://home.apache.org/~janhoy/no-test-2016-04-18.tgz >>>> >>>> I have also copied everything to the /no/ namespace and replaced all >>>> instances of "no-test" with “no” and zipped it as >>>> http://home.apache.org/~janhoy/no-2016-04-18.tgz - in my opinion it is >>>> good to go, replacing the very outdated current site. >>>> >>>> Next step after this will be enabling soft redirect for “nb”/“nn”, as well >>>> as translating the remaining sub pages under /no/product and /no/why >>> >>> great. :-) then I "just" need to find some time to commit your work. >>> Should I start with "no-test" or should I go directly to your "no" files? >>> >>> Thanks >>> >>> Marcus >>> >>> >>> >>>>> 16. apr. 2016 kl. 10.17 skrev Marcus<marcus.m...@wtnet.de>: >>>>> >>>>> Am 04/14/2016 02:29 PM, schrieb Jan Høydahl: >>>>>>>> Now, there is a feature on the site to show a redirect info box if you >>>>>>>> visit AOO in another language than your own. >>>>>>>> However, this is not triggered when I simply visit www.openoffice.org, >>>>>>>> but only when I explicitly select english >>>>>>>> as language in the topmost site language selector, opening >>>>>>>> http://www.openoffice.org/?redirect=soft (notice redirect param) >>>>>>>> That redirect link is broken for Norwegian, since it takes you to >>>>>>>> http://www.openoffice.org/nb resulting in a 404. >>>>>>>> The issue here is that “nb" is the ISO code for Norwegian Bokmål, also >>>>>>>> used in the download file name. But we have a >>>>>>>> common web site for Norwegian Bokmål and Norwegian Nynorsk at >>>>>>>> http://www.openoffice.org/no/ >>>>>>> >>>>>>> IMHO this reflects the old situation where we still counted with a 1:1 >>>>>>> connection between a localized OpenOffice installation and a respective >>>>>>> localized website. >>>>>>> >>>>>>> Of course we can change it to redirect to "no" only, when a localized >>>>>>> website in "nb" is not relevant. >>>>>> >>>>>> Yes, probably for most languages it is ok, but I have not tested all the >>>>>> others. >>>>>> >>>>>>>> I’d like to fix some of this. Here are some questions in that regard: >>>>>>>> >>>>>>>> * Is the info box supposed to show whenever another translation >>>>>>>> matching your browser setting is available? >>>>>>> >>>>>>> If you mean the yellow info box above the big headlines with "This site >>>>>>> is also available in<language>. Just click here", then it depends on >>>>>>> the setting for this language (see answer for next question). >>>>>>> >>>>>>> The redirect box is always visible regardless of the language of the >>>>>>> user's browser. >>>>>> >>>>>> Ok, so if I change setting from “none” to “soft” for Norwegian in file >>>>>> msg_prop_l10n.js then people with Norwegian language browser >>>>>> would start seeing the popup whenever they visit the default site or >>>>>> another language site? >>>>> >>>>> Yes, this is the intension of the function. >>>>> >>>>>> Wonder why most languages choose to have “none” for this setting? >>>>> >>>>> They haven't decided this but we as project have to have a starting point >>>>> (to leave it as most non-bothering for the users as possible). The only a >>>>> few decided to change it to "soft" and only one wanted to have "hard". >>>>> >>>>> Please note that it's also a question of how up-to-date the respective >>>>> localized webpages are. It doesn't make sense to offer a redirect to a >>>>> webpage when it's outdated or not existing. ;-) >>>>> >>>>>>>> * Why is it only the English dropdown option having ?redirect=soft >>>>>>> >>>>>>> You have need differentiate between "hard", "soft" and "none": >>>>>>> - "hard" --> do a redirect to the localized website without any hint. >>>>>>> - "soft" --> show a message that a localized website is available and >>>>>>> wait for the user's click. Then do the redirect. >>>>>>> - "none" --> do and show nothing. >>>>>>> >>>>>>> I think the parameter "soft" on the English webpage (as initial portal >>>>>>> website) has no meaning anymore as the "/msg_l10n.js" file is used. And >>>>>>> here it's "none". >>>>>>> >>>>>>> BTW: >>>>>>> Also here we need to do the "no"<--> "nb" cleanup. >>>>>> >>>>>> Yes. The browser may say “nb”, “nn”, “no”, “nb-NO”, “nn-NO” and all >>>>>> should redirect to “no”. >>>>>> I see in /index.html some explicit handling of “pt-pt” as well as >>>>>> “en-us", "en-gb” etc but probably more are missing. >>>>>> However, that may not be that visible if the feature mostly is disabled >>>>>> “none” for most languages. >>>>> >>>>> Yes, but see above. >>>>> >>>>>> Still, it would perhaps make sense to implement all these rules in a new >>>>>> JS function, where we explicitly verify that >>>>>> the resulting ISO code matches one of the existing website languages, >>>>>> and if not, cancel the redirect. >>>>>> >>>>>>>> * I’d like to change from having two Norwegian entries in the topmost >>>>>>>> site dropdown to only one (since both point to “no”) >>>>>>>> Please see edited brand.html file: >>>>>>>> http://home.apache.org/~janhoy/brand.html >>>>>>> >>>>>>> OK, this can be done. I would do it when the new "no" website is ready. >>>>>>> >>>>>>>> * For the problem of redirect box for Norwegian “nb” -> 404, >>>>>>>> should we edit the script in index.html >>>>>>>> to add an exception for Norwegian, like there is for Portuguese, or >>>>>>>> should the redirect variable in >>>>>>>> msg_prop_l10n.js add a third column being the language code to use >>>>>>>> when constructing the site URL? >>>>>>> >>>>>>> The redirection code is on the inital portal website. No need to change >>>>>>> something in the localized website. >>>>>> >>>>>> The redirection code is in an inline<script> in /index.html >>>>>> But in may also be copy/pasted elsewhere since the template site >>>>>> xx/index.html duplicates this JavaScipt logic instead >>>>>> of including scripts/ooo.js. >>>>>> >>>>>> In fact scripts/ooo.js is used nowhere, except index_test.html. Was this >>>>>> some work in progress being forgotten? >>>>> >>>>> Hm, I don't know anymore, it's long time ago. >>>>> >>>>>> Also the “xx” template suggests to customize xx/msg_prop_l10n_XX.js into >>>>>> a language specific version, >>>>>> duplicating the l10n.index_redirect_text variable all over the place. I >>>>>> can see this pattern currently being used by >>>>>> “da-test”, “gd”, “hi”, “hu”, “no-test”, “ru” and more…. >>>>>> The template should perhaps instead include /msg_prop_l10n.js to keep >>>>>> these definitions in one place, >>>>>> and xx/index.html should include /scripts/ooo.js to avoid duplication of >>>>>> the language selection logic. >>>>> >>>>> It looks like that the complete redirect functionality could owe an >>>>> update to simplify it and avoid duplicate code. But I need to dive deeper >>>>> into this to know exactly how it's working. For me it's longer ago since >>>>> I've implemented this. ;-) >>>>> >>>>>>> My suggestion is to make your updated "no-test" public. Then you can >>>>>>> see if it's ready to become "no" and then we can do the cleanup for >>>>>>> both Norwegian languages in the redirect box. >>>>>>> >>>>>>> Is that OK for you? Or do you have other suggestions? >>>>>> >>>>>> That is fine. >>>>> >>>>> Done. >>>>> >>>>> I've updated the "no-test" webpages (in "content/" and "templates/"). >>>>> Please test if anything is like it should. >>>>> >>>>> Two additions: >>>>> - The language select box is already updated to a single "no" entry. >>>>> - The download text on ".../no-test/index.html" still needs to be >>>>> translated. >>>>> - The file "/msg_prop_l10n.js" was updated to have only "no". >>>>> >>>>> Marcus > > --------------------------------------------------------------------- > To unsubscribe, e-mail: l10n-unsubscr...@openoffice.apache.org > For additional commands, e-mail: l10n-h...@openoffice.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: l10n-unsubscr...@openoffice.apache.org For additional commands, e-mail: l10n-h...@openoffice.apache.org