Skip to content

Commit 62f5e1a

Browse files
authored
Merge pull request #1537 from ychin/mmtabs-localization
MMTabline: Localize button strings
2 parents 018ee0f + 2b811bb commit 62f5e1a

26 files changed

+392
-25
lines changed

src/MacVim/MMTabline/MMTabline.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
button.action = action;
2222
button.continuous = continuous;
2323
[button sizeToFit];
24-
[button setToolTip:NSLocalizedString(tooltip, @"Tabline button")];
24+
[button setToolTip:tooltip];
2525
[tabline addSubview:button];
2626
return button;
2727
}
@@ -82,9 +82,9 @@ - (instancetype)initWithFrame:(NSRect)frameRect
8282
_scrollView.documentView = _tabsContainer;
8383
[self addSubview:_scrollView];
8484

85-
_addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, @"New Tab (⌘T)", @selector(addTabAtEnd), NO);
86-
_leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, @"Scroll Tabs", @selector(scrollLeftOneTab), YES);
87-
_rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, @"Scroll Tabs", @selector(scrollRightOneTab), YES);
85+
_addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, NSLocalizedString(@"create-new-tab-button", @"Create a new tab button"), @selector(addTabAtEnd), NO);
86+
_leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, NSLocalizedString(@"scroll-tabs-backward", @"Scroll backward button in tabs line"), @selector(scrollLeftOneTab), YES);
87+
_rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, NSLocalizedString(@"scroll-tabs-forward", @"Scroll forward button in tabs line"), @selector(scrollRightOneTab), YES);
8888

8989
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]];
9090
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]];

src/MacVim/MacVim.xcodeproj/project.pbxproj

+61-7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
6767
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
6868
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
69+
90290BB02D48649B00AA7489 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 90290BAE2D48649B00AA7489 /* Localizable.strings */; };
6970
907FF7512521BCE200BADACB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF74F2521BCE200BADACB /* MainMenu.xib */; };
7071
907FF7542521BDA600BADACB /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7522521BDA600BADACB /* Preferences.xib */; };
7172
907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7552521BDC200BADACB /* FindAndReplace.xib */; };
@@ -283,6 +284,28 @@
283284
901C07182430C8CD00797C2A /* viminfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = viminfo.c; path = ../viminfo.c; sourceTree = "<group>"; };
284285
901C07192430C8CD00797C2A /* filepath.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = filepath.c; path = ../filepath.c; sourceTree = "<group>"; };
285286
901C071A2430C8CD00797C2A /* session.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = session.c; path = ../session.c; sourceTree = "<group>"; };
287+
90290BAF2D48649B00AA7489 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
288+
90290BB12D4864C200AA7489 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
289+
90290BB22D486AC600AA7489 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
290+
90290BB32D486AC600AA7489 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
291+
90290BB42D486AC600AA7489 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
292+
90290BB52D48743A00AA7489 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
293+
90290BB62D48743A00AA7489 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = "<group>"; };
294+
90290BB72D48743A00AA7489 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
295+
90290BB82D48743A00AA7489 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
296+
90290BB92D48743A00AA7489 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
297+
90290BBA2D48743A00AA7489 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
298+
90290BBB2D48743A00AA7489 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
299+
90290BBC2D48743A00AA7489 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
300+
90290BBD2D48764E00AA7489 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; };
301+
90290BBE2D48764E00AA7489 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
302+
90290BBF2D48764E00AA7489 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = "<group>"; };
303+
90290BC02D48764E00AA7489 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
304+
90290BC12D48764E00AA7489 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = "<group>"; };
305+
90290BC22D4878BF00AA7489 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
306+
90290BC32D4878BF00AA7489 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
307+
90290BC42D4878BF00AA7489 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
308+
90290BC52D4878BF00AA7489 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
286309
907FF75A2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FindAndReplace.xib; sourceTree = "<group>"; };
287310
907FF75B2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Preferences.xib; sourceTree = "<group>"; };
288311
907FF75C2521C0A000BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -441,6 +464,13 @@
441464
90F84F312521F8760000268B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MainMenu.strings; sourceTree = "<group>"; };
442465
90F84F322521F87F0000268B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/MainMenu.strings; sourceTree = "<group>"; };
443466
90F84F332521F8880000268B /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/MainMenu.strings; sourceTree = "<group>"; };
467+
925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = "<group>"; };
468+
925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = "<group>"; };
469+
925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
470+
92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = "<group>"; };
471+
92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = "<group>"; };
472+
92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = "<group>"; };
473+
92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = "<group>"; };
444474
95241CE12573D587001E3711 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
445475
95241CF025749CC6001E3711 /* vim9type.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = vim9type.c; path = ../vim9type.c; sourceTree = "<group>"; };
446476
95241CF125749CC6001E3711 /* help.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = help.c; path = ../help.c; sourceTree = "<group>"; };
@@ -454,13 +484,6 @@
454484
95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = "<group>"; };
455485
95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = "<group>"; };
456486
95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = "<group>"; };
457-
925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = "<group>"; };
458-
925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = "<group>"; };
459-
925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
460-
92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = "<group>"; };
461-
92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = "<group>"; };
462-
92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = "<group>"; };
463-
92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = "<group>"; };
464487
/* End PBXFileReference section */
465488

466489
/* Begin PBXFrameworksBuildPhase section */
@@ -635,6 +658,7 @@
635658
29B97317FDCFA39411CA2CEA /* Resources */ = {
636659
isa = PBXGroup;
637660
children = (
661+
90290BAE2D48649B00AA7489 /* Localizable.strings */,
638662
1D384A0D100D671700D3C22F /* KeyBinding.plist */,
639663
1D9C602E0EF79C0C0034AD44 /* MacVim.icns */,
640664
0395A8A90D72D88B00881434 /* General.png */,
@@ -1036,6 +1060,7 @@
10361060
1DCD00C10E50B2B700460166 /* Cut.png in Resources */,
10371061
1DCD00C20E50B2B700460166 /* FindHelp.png in Resources */,
10381062
1DCD00C30E50B2B700460166 /* FindNext.png in Resources */,
1063+
90290BB02D48649B00AA7489 /* Localizable.strings in Resources */,
10391064
1DCD00C40E50B2B700460166 /* FindPrev.png in Resources */,
10401065
1DCD00C50E50B2B700460166 /* Help.png in Resources */,
10411066
1DCD00C60E50B2B700460166 /* LoadSesn.png in Resources */,
@@ -1259,6 +1284,35 @@
12591284
name = InfoPlist.strings;
12601285
sourceTree = "<group>";
12611286
};
1287+
90290BAE2D48649B00AA7489 /* Localizable.strings */ = {
1288+
isa = PBXVariantGroup;
1289+
children = (
1290+
90290BAF2D48649B00AA7489 /* en */,
1291+
90290BB12D4864C200AA7489 /* zh-Hant */,
1292+
90290BB22D486AC600AA7489 /* ja */,
1293+
90290BB32D486AC600AA7489 /* ko */,
1294+
90290BB42D486AC600AA7489 /* zh-Hans */,
1295+
90290BB52D48743A00AA7489 /* ca */,
1296+
90290BB62D48743A00AA7489 /* cs */,
1297+
90290BB72D48743A00AA7489 /* da */,
1298+
90290BB82D48743A00AA7489 /* de */,
1299+
90290BB92D48743A00AA7489 /* fi */,
1300+
90290BBA2D48743A00AA7489 /* fr */,
1301+
90290BBB2D48743A00AA7489 /* nl */,
1302+
90290BBC2D48743A00AA7489 /* pt-BR */,
1303+
90290BBD2D48764E00AA7489 /* hu */,
1304+
90290BBE2D48764E00AA7489 /* it */,
1305+
90290BBF2D48764E00AA7489 /* nb */,
1306+
90290BC02D48764E00AA7489 /* pl */,
1307+
90290BC12D48764E00AA7489 /* pt-PT */,
1308+
90290BC22D4878BF00AA7489 /* es */,
1309+
90290BC32D4878BF00AA7489 /* ru */,
1310+
90290BC42D4878BF00AA7489 /* sv */,
1311+
90290BC52D4878BF00AA7489 /* tr */,
1312+
);
1313+
name = Localizable.strings;
1314+
sourceTree = "<group>";
1315+
};
12621316
907FF74F2521BCE200BADACB /* MainMenu.xib */ = {
12631317
isa = PBXVariantGroup;
12641318
children = (

0 commit comments

Comments
 (0)