-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Pseudolocalization? #195
Comments
Looking at that linked document about Psuedo-Locales, it also mentions "qps-plocm" and "qps-ploca". Presumably those don't work with the above regex, so we would also need to expand the 'script' or 'region' subtags? Any idea which actual subtag those "ploc?" elements are? That doc mentions "private use space" which suggests the private-use subtag, yet those are prefixed with "-x-" according to BCP47. |
Elsewhere, it seems So if that's right (and that doc is in error) then all those will work fine with your change to the regex as it stands. Nice idea, BTW. |
Thanks. I'm just trying to make a small contribution to this really nice project. It's much better than Microsoft's localization via resx files, which are truly painful. I'm not completely sure about qps-plocm and qps-ploca, I ran the reg edit for just qps-ploc (you can tell it worked if you go to Control-Panel->Regions and you'll see the new Pseudo locale listed now), and then ran a powershell program (New-Object System.Globalization.CultureInfo qps-ploc) to make sure that the CultureInfo would accept the locale string since the code at some point must instantiate the CI object. When I'm at work tomorrow, I will try out qps-plocm, qps-mirr, qps-ploca and qps-asia and see what comes up. You might be right, the RegEx's may need a slight update to the script and region tags to account for them depending on what the CI object will accept. |
So today, I registered (via regedit), qps-ploca and qps-plocm. In my Control-Panel->Region->Format settings, I now have: Pseudo Language (Pseudo) If you run a Powershell, and run the following:
Those 3 lines are valid, so the code in LanguageTag will work well for those. However,
Both those lines generate errors, so I don't think they will work. You are right, the RegEx in LanguageTag will not work for those as is, so I've made the following adjustments:
These now work for qps-ploca and qps-plocm as well as qps-ploc. Also, for those people who might be following this thread. I left out a step. To my web.config, I had to add the following:
One other unrelated thing, in EarlyUrlLocalizer, I noticed that RedirectWithLanguage is always generating a ThreadAbortException at the following line:
In my version, I've replaced it with:
Which does not generate an error. I got it from KBS: https://support.microsoft.com/en-us/kb/312629 |
Thank you for that. I've made modifications accordingly. Cheers. |
HI there, I am using this framework in one of my own projects and we wanted to support pseudo localization: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319106(v=vs.85).aspx
To add support, I did the following, added those entries to the registry, so that CultureInfo("qps-ploc") for example generates a valid CultureInfo instantiation.
Then, I made a slight change to your regex expresssions to support 2 OR 3 character language codes in LanguageTag.cs:
Then in the locales folder, you'll need to create a pseudo locale (ie, locale\qps-ploc), with a message.po file which has been pseudo localized. It helps with our localization testing as we can see right away what labels we may have missed, or code that isn't working without having to actually wait for real translations.
Just thought you might want to consider adding support for it in your code moving forward and so I can also update our framework without having to reapply the changes every time.
The text was updated successfully, but these errors were encountered: