Made more UI elements localisable.
This commit is contained in:
1 parent
90103003bd
commit
a2e48e9895
3 files changed
+26
-15
No files matched your search
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11535.1" systemVersion="16B2553a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11535.1"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -20,7 +20,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="424" height="115"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ITP-pW-XrQ" propertyAccessControl="all">
|
||||
<textField verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ITP-pW-XrQ" propertyAccessControl="none">
|
||||
<rect key="frame" x="18" y="91" width="388" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" sendsActionOnEndEditing="YES" title="ItemName" id="5j3-R9-JdX">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
@@ -54,9 +54,9 @@
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsExpansionToolTips="YES" preferredMaxLayoutWidth="1200" translatesAutoresizingMaskIntoConstraints="NO" id="eTa-uz-sjk">
|
||||
<textField verticalHuggingPriority="750" allowsExpansionToolTips="YES" preferredMaxLayoutWidth="1200" translatesAutoresizingMaskIntoConstraints="NO" id="eTa-uz-sjk" propertyAccessControl="none">
|
||||
<rect key="frame" x="95" y="51" width="311" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="charWrapping" selectable="YES" sendsActionOnEndEditing="YES" title="long text long text long text long textlong text long text" id="5mD-V5-53a">
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="charWrapping" selectable="YES" sendsActionOnEndEditing="YES" title="do not localize" id="5mD-V5-53a">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -74,9 +74,9 @@
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsExpansionToolTips="YES" preferredMaxLayoutWidth="1200" translatesAutoresizingMaskIntoConstraints="NO" id="aBh-Is-f6Q">
|
||||
<textField verticalHuggingPriority="750" allowsExpansionToolTips="YES" preferredMaxLayoutWidth="1200" translatesAutoresizingMaskIntoConstraints="NO" id="aBh-Is-f6Q" propertyAccessControl="none">
|
||||
<rect key="frame" x="95" y="69" width="311" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="charWrapping" selectable="YES" sendsActionOnEndEditing="YES" title="long text long text long text long textlong text long text" id="OJa-Jm-vq4">
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="charWrapping" selectable="YES" sendsActionOnEndEditing="YES" title="do not localize" id="OJa-Jm-vq4">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -82,9 +82,14 @@ static NSArray<NSArray *> *_mediaKinds;
|
||||
selector:@selector(updateSetsMenu:)
|
||||
name:@"SBPresetManagerUpdatedNotification" object:nil];
|
||||
|
||||
NSArray<NSString *> *tagsMenu = [MP42Metadata writableMetadata];
|
||||
for (NSString *tag in tagsMenu) {
|
||||
[self.tagsPopUp addItemWithTitle:tag];
|
||||
NSArray<NSString *> *identifiersMenu = MP42Metadata.writableMetadata;
|
||||
NSMenu *menu = self.tagsPopUp.menu;
|
||||
NSUInteger tag = 0;
|
||||
for (NSString *identifier in identifiersMenu) {
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:localizedMetadataKeyName(identifier) action:nil keyEquivalent:@""];
|
||||
item.tag = tag;
|
||||
tag += 1;
|
||||
[menu addItem:item];
|
||||
}
|
||||
|
||||
self.column = self.metadataTableView.tableColumns[1];
|
||||
@@ -207,7 +212,7 @@ static NSArray<NSArray *> *_mediaKinds;
|
||||
|
||||
- (IBAction)addTag:(id)sender
|
||||
{
|
||||
NSString *identifier = [sender selectedItem].title;
|
||||
NSString *identifier = MP42Metadata.writableMetadata[[sender selectedItem].tag];
|
||||
|
||||
if (![self.metadata metadataItemsFilteredByIdentifier:identifier].count) {
|
||||
MP42MetadataItem *item = [MP42MetadataItem metadataItemWithIdentifier:identifier
|
||||
@@ -458,7 +463,7 @@ static NSArray<NSArray *> *_mediaKinds;
|
||||
|
||||
if ([tableColumn.identifier isEqualToString:@"key"]) {
|
||||
cell = [tableView makeViewWithIdentifier:@"NameTextCell" owner:self];
|
||||
cell.textField.stringValue = item.identifier;
|
||||
cell.textField.stringValue = localizedMetadataKeyName(item.identifier);
|
||||
}
|
||||
else if ([tableColumn.identifier isEqualToString:@"value"]) {
|
||||
switch (item.dataType) {
|
||||
|
||||
@@ -50,8 +50,14 @@ static void *SBMetadataPrefsViewControllerContex = &SBMetadataPrefsViewControlle
|
||||
|
||||
[self.builtInTokenField setTokenizingCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@"%"]];
|
||||
|
||||
for (NSString *tag in [MP42Metadata writableMetadata]) {
|
||||
[self.addMetadataPopUpButton addItemWithTitle:tag];
|
||||
NSArray<NSString *> *identifiersMenu = MP42Metadata.writableMetadata;
|
||||
NSMenu *menu = self.addMetadataPopUpButton.menu;
|
||||
NSUInteger tag = 0;
|
||||
for (NSString *identifier in identifiersMenu) {
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:localizedMetadataKeyName(identifier) action:nil keyEquivalent:@""];
|
||||
item.tag = tag;
|
||||
tag += 1;
|
||||
[menu addItem:item];
|
||||
}
|
||||
|
||||
// Load data from preferences
|
||||
@@ -63,7 +69,7 @@ static void *SBMetadataPrefsViewControllerContex = &SBMetadataPrefsViewControlle
|
||||
_tvShowMap = savedTvShowMap ? savedTvShowMap : [SBMetadataResultMap tvShowDefaultMap];
|
||||
|
||||
// Set up the sort descriptor
|
||||
NSArray<NSString *> *context = [MP42Metadata availableMetadata];
|
||||
NSArray<NSString *> *context = MP42Metadata.availableMetadata;
|
||||
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"key"
|
||||
ascending:YES
|
||||
comparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
|
||||
|
||||
Reference in new issue
Block a user