feat: add app.getPreferredSystemLanguages() API (#36035)
* feat: add app.getSystemLanguage() API * Change the API to getPreferredSystemLanguages * Fix test * Clarify docs and add Linux impl * Remove USE_GLIB * Don't add C to list * Remove examples since there's a lot of edge cases * Fix lint * Add examples * Fix compile error * Apply PR feedback * Update the example
This commit is contained in:
		
					parent
					
						
							
								8f5959aad2
							
						
					
				
			
			
				commit
				
					
						5fc3ed936e
					
				
			
		
					 6 changed files with 76 additions and 9 deletions
				
			
		|  | @ -67,6 +67,7 @@ | |||
| #include "shell/common/gin_converters/value_converter.h" | ||||
| #include "shell/common/gin_helper/dictionary.h" | ||||
| #include "shell/common/gin_helper/object_template_builder.h" | ||||
| #include "shell/common/language_util.h" | ||||
| #include "shell/common/node_includes.h" | ||||
| #include "shell/common/options_switches.h" | ||||
| #include "shell/common/platform_util.h" | ||||
|  | @ -1803,6 +1804,7 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) { | |||
|       .SetMethod("setAppLogsPath", &App::SetAppLogsPath) | ||||
|       .SetMethod("setDesktopName", &App::SetDesktopName) | ||||
|       .SetMethod("getLocale", &App::GetLocale) | ||||
|       .SetMethod("getPreferredSystemLanguages", &GetPreferredLanguages) | ||||
|       .SetMethod("getSystemLocale", &App::GetSystemLocale) | ||||
|       .SetMethod("getLocaleCountryCode", &App::GetLocaleCountryCode) | ||||
| #if BUILDFLAG(USE_NSS_CERTS) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Raymond Zhao
				Raymond Zhao