From d96b45cca8a4dfebfaf98b4f62059ba60f0139a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= Date: Mon, 26 Aug 2019 01:18:01 +0200 Subject: [PATCH] Add German translation (#77) * Add German translation popupMediaSelectCastLabel is intentionally left blank due to German grammar. * Fix receiver selector spacing for blank labels --- .../ViewController.swift | 18 +- ext/src/_locales/de/messages.json | 339 ++++++++++++++++++ ext/src/ui/popup/index.tsx | 16 +- ext/src/ui/popup/styles/index.css | 29 +- ext/src/ui/popup/styles/mac.css | 6 +- 5 files changed, 385 insertions(+), 23 deletions(-) create mode 100644 ext/src/_locales/de/messages.json diff --git a/app/NativeMacReceiverSelector/ViewController.swift b/app/NativeMacReceiverSelector/ViewController.swift index 2fb3a5f..4fc8057 100644 --- a/app/NativeMacReceiverSelector/ViewController.swift +++ b/app/NativeMacReceiverSelector/ViewController.swift @@ -91,11 +91,19 @@ class ViewController : NSViewController { withTag: initData.defaultMediaType.rawValue) - let mediaTypeStackView = NSStackView(views: [ - makeLabel(initData.i18n_mediaSelectCastLabel), - self.mediaTypePopUpButton, - makeLabel(initData.i18n_mediaSelectToLabel) - ]) + let mediaTypeStackView = NSStackView() + + if initData.i18n_mediaSelectCastLabel != "" { + mediaTypeStackView.addView( + makeLabel(initData.i18n_mediaSelectCastLabel), in: .leading) + } + + mediaTypeStackView.addView(self.mediaTypePopUpButton, in: .leading) + + if initData.i18n_mediaSelectToLabel != "" { + mediaTypeStackView.addView( + makeLabel(initData.i18n_mediaSelectToLabel), in: .leading) + } stackView.addArrangedSubview(mediaTypeStackView) diff --git a/ext/src/_locales/de/messages.json b/ext/src/_locales/de/messages.json new file mode 100644 index 0000000..7ae96d7 --- /dev/null +++ b/ext/src/_locales/de/messages.json @@ -0,0 +1,339 @@ +{ + "extensionName": { + "message": "EXTENSION_NAME" + , "description": "Name of the extension and the native receiver selector window title." + } + , "extensionDescription": { + "message": "Aktiviert Chromecast-Support zum Streamen von Web-Apps (wie Netflix oder BBC iPlayer), HTML5-Video und Bildschirm-/Tabfreigaben." + , "description": "Description of the extension shown in the add-ons manager." + } + + + , "popupMediaTypeApp": { + "message": "Die App dieser Seite" + , "description": "Receiver selector media type