mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] send langs to start page
This commit is contained in:
@ -1425,8 +1425,34 @@
|
||||
|
||||
NSEditorApi::CAscMenuEvent* pEvent = new NSEditorApi::CAscMenuEvent(ASC_MENU_EVENT_TYPE_CEF_EXECUTE_COMMAND_JS);
|
||||
pEvent->m_pData = pCommand;
|
||||
pEvent->AddRef();
|
||||
|
||||
[self.cefStartPageView apply:pEvent];
|
||||
|
||||
//NSLog(@"current locale: %@", [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]);
|
||||
NSDictionary * json_langs = @{
|
||||
@"locale": @{
|
||||
@"current": @"en-EN",
|
||||
@"langs": @{
|
||||
@"en-EN": @"English",
|
||||
@"ru-RU": @"Русский",
|
||||
@"de-DE": @"Deutsch",
|
||||
@"fr-FR": @"Français",
|
||||
@"es-ES": @"Español",
|
||||
@"sk-SK": @"Slovenčina",
|
||||
@"cs-CZ": @"Čeština",
|
||||
@"it-IT": @"Italiano",
|
||||
@"pt-BR": @"Português Brasileiro",
|
||||
@"pl-PL": @"Polski",
|
||||
@"zh-CN": @"中文"
|
||||
}
|
||||
}
|
||||
};
|
||||
pCommand->put_Command(L"settings:init");
|
||||
pCommand->put_Param([[json_langs jsonString] stdwstring]);
|
||||
|
||||
pEvent->m_pData = pCommand;
|
||||
[self.cefStartPageView apply:pEvent];
|
||||
}
|
||||
|
||||
- (void)onCEFEditorDocumentReady:(NSNotification *)notification {
|
||||
|
||||
@ -582,6 +582,10 @@ public:
|
||||
} else {
|
||||
[params addObject:[NSString stringWithFormat:@"lang=%@", [[[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] lowercaseString]]];
|
||||
}
|
||||
|
||||
if (NSString * langId = json[@"langid"]) {
|
||||
NSLog(@"new lang: %@", langId);
|
||||
}
|
||||
|
||||
if (NSString * userName = json[@"username"]) {
|
||||
if ([userName isEqualToString:@""]) {
|
||||
|
||||
Reference in New Issue
Block a user