How to change accept language in Chromium source code - chromium

I'm working on a Chromium project, which requires change the default language from English to Chinese from the source code and now open a Chinese page will appear garbled situation.
I modify the method GetApplicationLocale() in src/content/public/browser/content_browser_client.cc: return en-US to return zh-CN, but it doesn't work.
I want to change the language by modifing the source code rather than the setting button Language and input settings.

Related

Word Interop (COM) Proofing Options

I have documents that do not retain their proofing options.
I have some code that now ensures all styles are set to the correct language and has proofing turned on:
For Each s As Style In oDocument.Styles
Select Case s.Type
Case WdStyleType.wdStyleTypeCharacter, WdStyleType.wdStyleTypeParagraph, WdStyleType.wdStyleTypeTable
s.NoProofing = False
s.LanguageID = WdLanguageID.wdEnglishUK
End Select
Next
If I check the proofing options in the document without selecting any text, the following is displayed:
Proofing Options, No Text Selected
If I check the proofing options in the document with all text selected, the following is displayed: Proofing Options, All Text Selected
I have tried the following code snippet, but it did not work:
For Each range As Range In oDocument.Words
range.LanguageID = WdLanguageID.wdEnglishUK
range.NoProofing = False
range.LanguageDetected = False
Next
The behavior described in the question indicates mixed language formatting is present in the document.
Firstly, language formatting can be applied directly (similar to font formatting) rather than being controlled solely by styles. The language defined in a style will not override direct language formatting.
Additionally, "odd" behavior with language formatting often occurs when a document was created on a machine where the OS default language is different from Word's default language. The problem began with Office 97, where Microsoft changed Word's default behavior and has it check the Windows language and apply it to a new document if Word's default language is not identical. The information is written deeply into the document structure, where the Word UI is not able to change it. It can only be removed by editing the underlying Word Open XML.
Due to massive complaints by professionals who use Word, the behavior was somewhat alleviated in later versions to the point where selecting the entire body of the document (Ctrl+A) then applying the desired language directly could mostly prevent newly added text from being incorrectly formatted with the Windows language.
If manually selecting the entire document and applying the language directly does not change the behavior (object model equivalent Document.Content.LanguageID =), the only recourse would be to delve into the document's "zip package", inspect the XML to track down where the other language is stored, and remove it. This information can be used to create a solution with the Open XML SDK (or using standard Packaging and XML namespaces in the .NET Framework) so that it can be used on "any" document (YMMV)
Note: I have done this manually, but it was some time ago, so I don't remember exactly in which XML file in the zip package the Windows language is written.

Incorrect Japanese font rendering inside NSControl object

I'm building a UI application in macOS with dynamic localization (meaning that it's possible to switch language while the application is running).
I've noticed that if the initial language is configured to Japanese, and I switch to English on-the-fly, the text on the controls is rendered ok.
However, on the opposite case, when the initial language is English and I switch to Japanese on-the-fly, the Japanese symbols on the text field come out a little bit enlarged. (see below drawings to emphasize the difference - the left snippet is the original rendering while the right one represents the enlarged version)
For any particular control, the language is changed by simply assigning the localized string (taken with help of NSLocalizedString function) to the stringValue property of the control.
These results appeared on all versions I've tested (both 10.13 and 10.12).
Perhaps anybody encountered similar results? how should I resolve them ?
So apparently the rendering problem is resolved if the Language is properly installed on your machine under Language and Regions -> Preferred Languages

I can not change language on xwiki

Dose anyone know how to change language on xwiki?
I followed this link below, but, nothing change at all.
http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/I18N
The step is following.
Go to XWikiPreferences.
Click content.
Click localization.
Change SUPPORTED LANGUAGES and default language.
I am Japanese so I choose Japanese, namely 日本語.
Set timezone
Click on save button.
Environment: Centos 6
java 1.8.0
xwiki 10.1
Do I have to take another action when I want to change language?
Best regards,
TL;DR: It worked, but unfortunately XWiki's User Interface is not yet translated into Japanese. Check by editing a page and looking at the editor's labels.
Longer answer:
As you can see from the link you mentioned (and the updated list http://l10n.xwiki.org/xwiki/bin/view/L10N/ - see the "Supported Languages" panel, on the right), XWiki does not list Japanese as supported language. This just means that there are no available translations for that language, so the User Interface will show the text labels in the English default.
This does not stop you from setting your wiki, as you did, to use the Japanese language. One way to check that the setting has taken effect is to edit a page and see the WYSIWYG editor's UI showing labels (like when hovering with the mouse over its buttons) in Japanese. This is a bit of a special case, since that editor provides its own translations and it just happens that it includes Japanese. (for information, that component is a 3rd party project, integrated into XWiki, so it manages its own translations that get distributed and integrated with the editor)
Additionally, if you set your wiki to be multilingual, it makes sense to use even languages where the UI is not translated yet because you will be able to edit various translations for the same page, should your usecase need that feature.
If you want to do something about it, you are welcomed to check out the translations wiki http://l10n.xwiki.org/xwiki/bin/view/L10N/ and start translating XWiki's UI for the Japanese language. The next release will include your translations and a lot of people, including yourself, will be grateful for it :)

Make user defined language in Notepad++ work regardless of theme

I have imported a Less style that a developer had recommended on this website, but there is a slight problem - it is made for specific themes only.
Without editing any XML files, is there any way to get this language file working regardless of theming? Like the built-in languages.
Language file working regardless of the theme – as far as I know the answer is no. Also check here.
If you do not want to edit XML files, you can still change colors by selecting Define your language... item in menu Language and change the colors of syntax categories using color pickers.
Adding your language into list of built-in languages is not easily possible unless you wish to play with N++ sources. You are supposed to use user-defined languages for standard tasks. However you can:
disable all unnecessarly languages in Language menu section in Preferences window and uncheck the Make language menu compact so you will get flat list of languages in menu.
access your language menu item faster by pressing Alt+L, then 2×Up and Enter

TeXnicCenter - spelling not working correctly

I have installed 2.02 Stable 64 bit version of TeXnicCenter and have following problem with spelling check. In one of my existing LaTeX document the grammar of the text in English is checked correctly and all typos are being underlined. In this file German language is not being recognise although I change setting for the language in the options for spelling. However, in other of my existing LaTex document the spelling tool is not recognising English text but it recognises text in German.
Here some hint: It could be that the other LaTex file has been created within German Windows environment. Now I have the Win 7 environment in English. Is it possible that it is connected with the text formatting? Is it possible to change it? Or is there a different cause?
Some other hint: When I generate a new LaTex file the spelling works fine for both English and German. So it is just the problem with the existing document.
Good hint from your side towards text encoding Phil. Solution is a bit different though. Apparently TexnicCenter is saving .tex files with ANSI encoding as default. As soon as .tex files are saved with UTF-8 encoding, spelling check works fine. There are not options to be set in the program. One has to go through Files->Save As and set the encoding while saving.
I know this is an old topic but here is what solved my issue: manually change the project language. Go to project > properties and then change the language there.