diff --git a/Frameworks/Foundation/ObjJ.environment/Foundation.sj b/Frameworks/Foundation/ObjJ.environment/Foundation.sj index 04799e5b5..3f85cfbdd 100644 --- a/Frameworks/Foundation/ObjJ.environment/Foundation.sj +++ b/Frameworks/Foundation/ObjJ.environment/Foundation.sj @@ -10528,7 +10528,7 @@ var _CPKVOInfoMake = function(anObserver, theOptions, aContext, aForwarder) { return {observer: anObserver, options: theOptions, context: aContext, forwarder: aForwarder}; }; -objj_executeFile("CPArray+KVO.j", YES);objj_executeFile("CPSet+KVO.j", YES);p;10;CPLocale.jt;8992;@STATIC;1.0;i;10;CPObject.jt;8958;objj_executeFile("CPObject.j", YES);CPLocaleIdentifier = "CPLocaleIdentifier"; +objj_executeFile("CPArray+KVO.j", YES);objj_executeFile("CPSet+KVO.j", YES);p;10;CPLocale.jt;9223;@STATIC;1.0;i;10;CPObject.jt;9189;objj_executeFile("CPObject.j", YES);CPLocaleIdentifier = "CPLocaleIdentifier"; CPLocaleLanguageCode = "CPLocaleLanguageCode"; CPLocaleCountryCode = "CPLocaleCountryCode"; CPLocaleScriptCode = "CPLocaleScriptCode"; @@ -10632,10 +10632,20 @@ class_addMethods(meta_class, [new objj_method(sel_getUid("systemLocale"), functi language = typeof navigator.language !== "undefined" ? navigator.language : navigator.userLanguage; if (language) { - language = language.replace("-", "_").substring(0, 5); - language = language.substring(0, 3).toLowerCase() + language.substring(3, 5).toUpperCase(); - if ((availableLocaleIdentifiers == null ? availableLocaleIdentifiers : (availableLocaleIdentifiers.isa.method_msgSend["indexOfObject:"] || _objj_forward)(availableLocaleIdentifiers, "indexOfObject:", language)) !== CPNotFound) - localeIdentifier = language; + var parts = language.split("-"); + if (parts.length > 1) + { + var langCode = parts[0].toLowerCase(); + var regionCode = parts[parts.length - 1].toUpperCase(); + localeIdentifier = langCode + "_" + regionCode; + } + else + { + var langCode = parts[0].toLowerCase(); + var defaultRegions = {"de": "DE", "en": "US", "es": "ES", "fr": "FR", "sv": "SE"}; + var regionCode = defaultRegions[langCode] || langCode.toUpperCase(); + localeIdentifier = langCode + "_" + regionCode; + } } } sharedCurrentLocale = ((___r1 = (CPLocale.isa.method_msgSend["alloc"] || _objj_forward)(CPLocale, "alloc")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["initWithLocaleIdentifier:"] || _objj_forward)(___r1, "initWithLocaleIdentifier:", localeIdentifier)); diff --git a/Resources/recipes.txt b/Resources/recipes.txt index 5f73bf746..7282f6953 100644 --- a/Resources/recipes.txt +++ b/Resources/recipes.txt @@ -1,144 +1,144 @@ -1773592904587|ArrayController1| -1773592904601|ArrayControllerInitialSelectionTest| -1773592904615|ArrayControllerRemovingFirstTest| -1773592904628|AttachedSheet| -1773592904642|AttachedSheet2| -1773592904655|Bindings| -1773592904669|CGCanvasContext| -1773592904682|CGPath| -1773592904696|CPAlertTest| -1773592904709|CPAnimatablePropertyContainerTest| -1773592904723|CPAnimationContextTest| -1773592904736|CPAnimationTest| -1773592904750|CPBinder-echo-bug| -1773592904763|CPBoxCibTest| -1773592904777|CPBoxTest| -1773592904791|CPBrowserTest| -1773592904804|CPButtonKeyEquivalentDefaultTest| -1773592904818|CPButtonTest| -1773592904831|CPByteCountFormatter| -1773592904845|CPCollectionViewNibTest| -1773592904858|CPColor-CPImage-description| -1773592904872|CPColorWellBindings| -1773592904885|CPComboBoxTest| -1773592904899|CPControlPerformClickExceptionTest| -1773592904912|CPControlSize| -1773592904926|CPCursor| -1773592904939|CPDateFormatterTest| -1773592904953|CPDatePickerTest| -1773592904966|CPDictionaryControllerTest| -1773592904980|CPDocumentControllerTest| -1773592904993|CPFormatterTest| -1773592905007|CPGraphicsTest| -1773592905020|CPImageAndTextViewImageScaling| -1773592905034|CPImageViewAlignmentScaling| -1773592905047|CPImageViewTest| -1773592905061|CPImageViewbindingsTest| -1773592905074|CPLevelIndicator| -1773592905088|CPLocalizationTest| -1773592905101|CPLogTest| -1773592905115|CPMenuCALayerTest| -1773592905128|CPMenuEnabledBindingsTest| -1773592905142|CPMenuKeyEquivalents| -1773592905155|CPMenuRemoveAllTest| -1773592905169|CPMenuSubmenuPlacementConstraints| -1773592905182|CPMenuTest| -1773592905196|CPOutlineViewCibTest| -1773592905209|CPOutlineViewTest| -1773592905223|CPOutlineViewViewBasedCibTest| -1773592905236|CPPanelTest| -1773592905250|CPPlatformWindow| -1773592905264|CPPlattformWindowMinSize| -1773592905277|CPPopUpButtonBindings| -1773592905291|CPPopUpButtonTest| -1773592905304|CPPopover| -1773592905318|CPPredicateEditorCibTest| -1773592905332|CPProgressIndicator| -1773592905345|CPPropertyListSerializationTest| -1773592905359|CPRadioBindings| -1773592905372|CPRuleEditorCibTest| -1773592905386|CPScrollView| -1773592905399|CPScrollView2| -1773592905413|CPSearchField| -1773592905426|CPSearchFieldPredicateBinding| -1773592905440|CPSegmentedControlBindings| -1773592905454|CPSegmentedControlTest| -1773592905467|CPSoundTest| -1773592905481|CPSplitViewDivider| -1773592905494|CPSplitViewTest| -1773592905508|CPStackViewTest| -1773592905521|CPStepperBindings| -1773592905535|CPStepperNibTest| -1773592905548|CPTabView2| -1773592905562|CPTabViewBindings| -1773592905575|CPTabViewNib| -1773592905589|CPTableViewGroupRows| -1773592905602|CPTextField| -1773592905616|CPTextFieldEditingStyleTest| -1773592905629|CPTextFieldHeightTest| -1773592905643|CPTextFieldMovementsTest| -1773592905656|CPTextFieldMultiline| -1773592905670|CPTextView| -1773592905683|CPTextViewCibTest| -1773592905697|CPTextViewDelegateAndNotifications| -1773592905710|CPTimeZone| -1773592905724|CPTokenFieldTest| -1773592905737|CPToolTip| -1773592905751|CPToolbarTest| -1773592905764|CPTreeControllerTest| -1773592905778|CPURLConnectionAsyncTest| -1773592905791|CPURLConnectionSynchronousTest| -1773592905805|CPUserDefaults| -1773592905818|CPUserDefaultsControllerTest| -1773592905832|CPUserNotificationTest| -1773592905845|CPViewController| -1773592905859|CPVisualEffectViewTest| -1773592905873|CPWebViewTest| -1773592905886|CPWebViewTest2| -1773592905900|CPWindowLiveResizeTest| -1773592905913|CPWindowMovableTest| -1773592905927|CPWindowResizeStyle| -1773592905940|ChildWindows| -1773592905954|CompilationTests| -1773592905967|ContinuouslyUpdatesValueBinding| -1773592905981|CopyAndPaste| -1773592905994|CrossOriginTest| -1773592906008|FF4096Test| -1773592906021|FontEnhancementTest| -1773592906035|FontMetricsExplorer| -1773592906048|KeyEquivalents| -1773592906062|KeyViewLoopTest| -1773592906075|KeyWindowInTheBackgroundActivation| -1773592906089|LayoutTest| -1773592906102|LoadTimeTest| -1773592906116|LongBindings| -1773592906129|MobileTest| -1773592906143|MultipleValueBindings| -1773592906157|NSBoxTest| -1773592906170|NSBrowserTest| -1773592906184|NewTextFieldBezel| -1773592906197|Nib2CibAlignment| -1773592906211|Nib2CibBaselineAlignementTest| -1773592906224|Nib2CibSubviewsOrderTest| -1773592906238|NibAppRemixed| -1773592906251|PatternFillTest| -1773592906265|PlatformWindows| -1773592906278|PopUpButtonEscTest| -1773592906292|ScalingTest| -1773592906305|ScalingTest2| -1773592906319|ScrollviewTheming| -1773592906332|SheetWindowOrderFrontIssue| -1773592906346|SimpleBindings2| -1773592906359|SmartFoldersDemo| -1773592906373|TableTest| -1773592906386|ThemeBrowser| -1773592906400|ThemeKitchenSink| -1773592906413|TrackingArea| -1773592906427|UndoRedoWithMenuUpdate| -1773592906440|UserlandNSTest| -1773592906454|layoutEphemeralSubviewTest| -1773592906467|loadDynamicFrameworks| -1773592906481|performKeyEquivalentTest| -1773592906494|predicateWithFormat| -1773592906508|resignFirstResponder-CPControlTextDidEndEditing| -1773592906521|sizeToFitFix| +1774384612748|ArrayController1| +1774384612762|ArrayControllerInitialSelectionTest| +1774384612776|ArrayControllerRemovingFirstTest| +1774384612790|AttachedSheet| +1774384612804|AttachedSheet2| +1774384612817|Bindings| +1774384612831|CGCanvasContext| +1774384612845|CGPath| +1774384612858|CPAlertTest| +1774384612872|CPAnimatablePropertyContainerTest| +1774384612886|CPAnimationContextTest| +1774384612900|CPAnimationTest| +1774384612913|CPBinder-echo-bug| +1774384612927|CPBoxCibTest| +1774384612941|CPBoxTest| +1774384612955|CPBrowserTest| +1774384612969|CPButtonKeyEquivalentDefaultTest| +1774384612983|CPButtonTest| +1774384612997|CPByteCountFormatter| +1774384613011|CPCollectionViewNibTest| +1774384613024|CPColor-CPImage-description| +1774384613038|CPColorWellBindings| +1774384613052|CPComboBoxTest| +1774384613066|CPControlPerformClickExceptionTest| +1774384613080|CPControlSize| +1774384613093|CPCursor| +1774384613107|CPDateFormatterTest| +1774384613121|CPDatePickerTest| +1774384613135|CPDictionaryControllerTest| +1774384613149|CPDocumentControllerTest| +1774384613163|CPFormatterTest| +1774384613177|CPGraphicsTest| +1774384613191|CPImageAndTextViewImageScaling| +1774384613205|CPImageViewAlignmentScaling| +1774384613219|CPImageViewTest| +1774384613233|CPImageViewbindingsTest| +1774384613247|CPLevelIndicator| +1774384613260|CPLocalizationTest| +1774384613274|CPLogTest| +1774384613288|CPMenuCALayerTest| +1774384613302|CPMenuEnabledBindingsTest| +1774384613316|CPMenuKeyEquivalents| +1774384613331|CPMenuRemoveAllTest| +1774384613345|CPMenuSubmenuPlacementConstraints| +1774384613359|CPMenuTest| +1774384613373|CPOutlineViewCibTest| +1774384613387|CPOutlineViewTest| +1774384613402|CPOutlineViewViewBasedCibTest| +1774384613416|CPPanelTest| +1774384613430|CPPlatformWindow| +1774384613445|CPPlattformWindowMinSize| +1774384613459|CPPopUpButtonBindings| +1774384613473|CPPopUpButtonTest| +1774384613488|CPPopover| +1774384613502|CPPredicateEditorCibTest| +1774384613516|CPProgressIndicator| +1774384613530|CPPropertyListSerializationTest| +1774384613544|CPRadioBindings| +1774384613558|CPRuleEditorCibTest| +1774384613572|CPScrollView| +1774384613585|CPScrollView2| +1774384613599|CPSearchField| +1774384613613|CPSearchFieldPredicateBinding| +1774384613627|CPSegmentedControlBindings| +1774384613641|CPSegmentedControlTest| +1774384613655|CPSoundTest| +1774384613668|CPSplitViewDivider| +1774384613682|CPSplitViewTest| +1774384613696|CPStackViewTest| +1774384613710|CPStepperBindings| +1774384613723|CPStepperNibTest| +1774384613737|CPTabView2| +1774384613751|CPTabViewBindings| +1774384613764|CPTabViewNib| +1774384613778|CPTableViewGroupRows| +1774384613792|CPTextField| +1774384613806|CPTextFieldEditingStyleTest| +1774384613819|CPTextFieldHeightTest| +1774384613833|CPTextFieldMovementsTest| +1774384613847|CPTextFieldMultiline| +1774384613861|CPTextView| +1774384613875|CPTextViewCibTest| +1774384613889|CPTextViewDelegateAndNotifications| +1774384613903|CPTimeZone| +1774384613918|CPTokenFieldTest| +1774384613932|CPToolTip| +1774384613947|CPToolbarTest| +1774384613961|CPTreeControllerTest| +1774384613975|CPURLConnectionAsyncTest| +1774384613989|CPURLConnectionSynchronousTest| +1774384614004|CPUserDefaults| +1774384614018|CPUserDefaultsControllerTest| +1774384614033|CPUserNotificationTest| +1774384614047|CPViewController| +1774384614061|CPVisualEffectViewTest| +1774384614075|CPWebViewTest| +1774384614089|CPWebViewTest2| +1774384614104|CPWindowLiveResizeTest| +1774384614118|CPWindowMovableTest| +1774384614132|CPWindowResizeStyle| +1774384614146|ChildWindows| +1774384614160|CompilationTests| +1774384614174|ContinuouslyUpdatesValueBinding| +1774384614188|CopyAndPaste| +1774384614202|CrossOriginTest| +1774384614217|FF4096Test| +1774384614231|FontEnhancementTest| +1774384614246|FontMetricsExplorer| +1774384614260|KeyEquivalents| +1774384614274|KeyViewLoopTest| +1774384614288|KeyWindowInTheBackgroundActivation| +1774384614303|LayoutTest| +1774384614317|LoadTimeTest| +1774384614332|LongBindings| +1774384614346|MobileTest| +1774384614361|MultipleValueBindings| +1774384614375|NSBoxTest| +1774384614390|NSBrowserTest| +1774384614404|NewTextFieldBezel| +1774384614419|Nib2CibAlignment| +1774384614433|Nib2CibBaselineAlignementTest| +1774384614448|Nib2CibSubviewsOrderTest| +1774384614462|NibAppRemixed| +1774384614477|PatternFillTest| +1774384614491|PlatformWindows| +1774384614504|PopUpButtonEscTest| +1774384614518|ScalingTest| +1774384614532|ScalingTest2| +1774384614546|ScrollviewTheming| +1774384614561|SheetWindowOrderFrontIssue| +1774384614575|SimpleBindings2| +1774384614590|SmartFoldersDemo| +1774384614605|TableTest| +1774384614619|ThemeBrowser| +1774384614633|ThemeKitchenSink| +1774384614647|TrackingArea| +1774384614662|UndoRedoWithMenuUpdate| +1774384614676|UserlandNSTest| +1774384614691|layoutEphemeralSubviewTest| +1774384614705|loadDynamicFrameworks| +1774384614720|performKeyEquivalentTest| +1774384614734|predicateWithFormat| +1774384614749|resignFirstResponder-CPControlTextDidEndEditing| +1774384614763|sizeToFitFix|