Skip to content

Commit

Permalink
Russian localization, fixed fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
VityaSchel committed Sep 29, 2023
1 parent c0d5181 commit e050e27
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 77 deletions.
21 changes: 21 additions & 0 deletions Shared/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Localizable.strings
samsung-pinger

Created by Виктор Щелочков on 29.09.2023.

*/

"settings_label" = "To be able to ping your device, this widget needs your Samsung's SmartThingsFind tokens and Device ID. This information never leaves your computer and won't be shared with anyone. You can review source code at ";
"instructions_label" = "Don't know how to find these values?";
"instructions_link" = "View instructions";
"settings_field_ping_text" = "Ping text (optional):";
"settings_field_ping_placeholder" = "Samsung Pinger is ringing this phone!";
"saved_successfully_message" = "Saved successfully!";
"validation_error_message" = "Validation Error";
"required_field_error" = " is a required field. If you don't know where to find this token, please refer to instructions in README.md file on GitHub";
"device_id_validation_error" = "Device ID must only consist of numbers";
"ringing_view_connecting" = "Connecting...";
"ringing_view_ringing" = "Ringing your Samsung device...";
"error" = "Error";
"save_button" = "Save";
21 changes: 21 additions & 0 deletions Shared/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Localizable.strings
samsung-pinger

Created by Виктор Щелочков on 29.09.2023.

*/

"settings_label" = "Чтобы пинговать ваше устройство, этому виджеты нужны токены SmartThingsFind и Device ID. Эти данные никогда не покидают ваш компьютер и никому не передаются. Узнайте больше на ";
"instructions_label" = "Узнайте, как получить значения ниже:";
"instructions_link" = "Инструкция";
"settings_field_ping_text" = "Текст на экране (необязательно):";
"settings_field_ping_placeholder" = "Samsung Pinger звонит на этот телефон!";
"saved_successfully_message" = "Успешно сохранено!";
"validation_error_message" = "Ошибка валидации";
"required_field_error" = " это обязательное поле. Если вы не знаете, где найти это значение, пожалуйста, обратитесь к инструкции в README.md на GitHub";
"device_id_validation_error" = "Device ID может состоять только из цифр";
"ringing_view_connecting" = "Подключение...";
"ringing_view_ringing" = "Звонок на устройство...";
"error" = "Ошибка";
"save_button" = "Сохранить";
75 changes: 51 additions & 24 deletions samsung-pinger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
A74393AE2AC6C487000A5682 /* samsungsharpsans-bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */; };
A74393B22AC6CBAD000A5682 /* samsungsharpsans-medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */; };
A74393B32AC6CBAD000A5682 /* samsungsharpsans-medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */; };
A74393B62AC6CDD0000A5682 /* samsungsharpsans-bold.otf in CopyFiles */ = {isa = PBXBuildFile; fileRef = A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */; };
A74393B72AC6CDD2000A5682 /* samsungsharpsans-medium.otf in CopyFiles */ = {isa = PBXBuildFile; fileRef = A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */; };
A74393B62AC6CDD0000A5682 /* samsungsharpsans-bold.otf in Copy Files */ = {isa = PBXBuildFile; fileRef = A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */; };
A74393B72AC6CDD2000A5682 /* samsungsharpsans-medium.otf in Copy Files */ = {isa = PBXBuildFile; fileRef = A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */; };
A76669EC2AC7317E005FE393 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A76669EF2AC7317E005FE393 /* Localizable.strings */; };
A76669ED2AC7317E005FE393 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A76669EF2AC7317E005FE393 /* Localizable.strings */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -49,15 +51,16 @@
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
A74393B52AC6CDBF000A5682 /* CopyFiles */ = {
A74393B52AC6CDBF000A5682 /* Copy Files */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = Fonts;
dstSubfolderSpec = 7;
files = (
A74393B72AC6CDD2000A5682 /* samsungsharpsans-medium.otf in CopyFiles */,
A74393B62AC6CDD0000A5682 /* samsungsharpsans-bold.otf in CopyFiles */,
A74393B72AC6CDD2000A5682 /* samsungsharpsans-medium.otf in Copy Files */,
A74393B62AC6CDD0000A5682 /* samsungsharpsans-bold.otf in Copy Files */,
);
name = "Copy Files";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
Expand All @@ -81,6 +84,8 @@
A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "samsungsharpsans-bold.otf"; sourceTree = "<group>"; };
A74393B02AC6CAEF000A5682 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "samsungsharpsans-medium.otf"; sourceTree = "<group>"; };
A76669EE2AC7317E005FE393 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
A76669F02AC73184005FE393 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -106,7 +111,7 @@
A714E6662AC5CE85006C139D = {
isa = PBXGroup;
children = (
A74393AA2AC6C43E000A5682 /* Shared */,
A76669EA2AC73083005FE393 /* Shared */,
A714E6712AC5CE86006C139D /* samsung-pinger */,
A714E68B2AC5CF7D006C139D /* widget */,
A714E6862AC5CF7D006C139D /* Frameworks */,
Expand All @@ -131,6 +136,7 @@
A714E6742AC5CE86006C139D /* ContentView.swift */,
A74393A52AC6C174000A5682 /* RingingView.swift */,
A714E6762AC5CE87006C139D /* Assets.xcassets */,
A74393AB2AC6C443000A5682 /* fonts */,
A714E67B2AC5CE87006C139D /* samsung_pinger.entitlements */,
A714E6782AC5CE87006C139D /* Preview Content */,
);
Expand Down Expand Up @@ -166,21 +172,21 @@
path = widget;
sourceTree = "<group>";
};
A74393AA2AC6C43E000A5682 /* Shared */ = {
A74393AB2AC6C443000A5682 /* fonts */ = {
isa = PBXGroup;
children = (
A74393AB2AC6C443000A5682 /* fonts */,
A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */,
A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */,
);
path = Shared;
path = fonts;
sourceTree = "<group>";
};
A74393AB2AC6C443000A5682 /* fonts */ = {
A76669EA2AC73083005FE393 /* Shared */ = {
isa = PBXGroup;
children = (
A74393AC2AC6C487000A5682 /* samsungsharpsans-bold.otf */,
A74393B12AC6CBAD000A5682 /* samsungsharpsans-medium.otf */,
A76669EF2AC7317E005FE393 /* Localizable.strings */,
);
path = fonts;
path = Shared;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -194,7 +200,7 @@
A714E66C2AC5CE85006C139D /* Frameworks */,
A714E66D2AC5CE85006C139D /* Resources */,
A714E69B2AC5CF7F006C139D /* Embed Foundation Extensions */,
A74393B52AC6CDBF000A5682 /* CopyFiles */,
A74393B52AC6CDBF000A5682 /* Copy Files */,
);
buildRules = (
);
Expand Down Expand Up @@ -248,6 +254,7 @@
knownRegions = (
en,
Base,
ru,
);
mainGroup = A714E6662AC5CE85006C139D;
productRefGroup = A714E6702AC5CE86006C139D /* Products */;
Expand All @@ -265,6 +272,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A76669EC2AC7317E005FE393 /* Localizable.strings in Resources */,
A714E67A2AC5CE87006C139D /* Preview Assets.xcassets in Resources */,
A74393B22AC6CBAD000A5682 /* samsungsharpsans-medium.otf in Resources */,
A714E6772AC5CE87006C139D /* Assets.xcassets in Resources */,
Expand All @@ -277,6 +285,7 @@
buildActionMask = 2147483647;
files = (
A714E6902AC5CF7F006C139D /* Assets.xcassets in Resources */,
A76669ED2AC7317E005FE393 /* Localizable.strings in Resources */,
A74393AE2AC6C487000A5682 /* samsungsharpsans-bold.otf in Resources */,
A74393B32AC6CBAD000A5682 /* samsungsharpsans-medium.otf in Resources */,
);
Expand Down Expand Up @@ -315,6 +324,18 @@
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
A76669EF2AC7317E005FE393 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
A76669EE2AC7317E005FE393 /* en */,
A76669F02AC73184005FE393 /* ru */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
A714E67C2AC5CE87006C139D /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -370,6 +391,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "Samsung Pinger";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -423,6 +445,7 @@
MACOSX_DEPLOYMENT_TARGET = 13.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "Samsung Pinger";
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
Expand All @@ -435,10 +458,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "samsung-pinger/samsung_pinger.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"samsung-pinger/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -450,7 +474,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = "dev.hloth.samsung-pinger";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -464,10 +489,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "samsung-pinger/samsung_pinger.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"samsung-pinger/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -479,7 +505,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = "dev.hloth.samsung-pinger";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -494,18 +521,18 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = widget/widget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_CFBundleDisplayName = "Samsung Pinger";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = "dev.hloth.samsung-pinger.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -521,18 +548,18 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = widget/widget.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_CFBundleDisplayName = "Samsung Pinger";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = "dev.hloth.samsung-pinger.widget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
22 changes: 11 additions & 11 deletions samsung-pinger/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct ContentView: View {
var body: some View {
VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text("To be able to ping your device, this widget needs your Samsung's SmartThingsFind tokens and Device ID. This information never leaves your computer and won't be shared with anyone. You can review source code at ")
Text("settings_label")
Button(action: {}) {
Text("https://github.com/vityaschel/samsung-pinger").underline()
.foregroundColor(Color.blue)
Expand All @@ -37,14 +37,14 @@ struct ContentView: View {
.frame(width: 370, alignment: .leading)
.padding(.bottom, 20)
HStack {
Text("Don't know how to find these values?")
Text("instructions_label")
.fontWeight(.bold)
Button(action: {
if let url = URL(string: "https://github.com/vityaschel/samsung-pinger#setup") {
NSWorkspace.shared.open(url)
}
}) {
Text("View instructions").underline()
Text("instructions_link").underline()
.foregroundColor(Color.blue)
}.buttonStyle(PlainButtonStyle())
.onHover { inside in
Expand All @@ -56,16 +56,16 @@ struct ContentView: View {
}
}
.padding(.bottom, 10)
field(title: "Ping text (optional):", placeholder: "Samsung Pinger is ringing this phone!", text: $pingText)
field(title: NSLocalizedString("settings_field_ping_text", comment: "Ping text (optional)"), placeholder: "settings_field_ping_placeholder", text: $pingText)
field(title: "JSESSIONID:", text: $jsessionID)
field(title: "WMONID:", text: $wmonID)
field(title: "Device ID:", text: $deviceID)
HStack {
Button(action: saveFields) {
Text("Save")
Text("save_button")
}
if showMessage {
Text("Saved successfully!")
Text("saved_successfully_message")
.fontWeight(.bold)
.foregroundColor(.green)
}
Expand All @@ -74,28 +74,28 @@ struct ContentView: View {
.padding()
.frame(width: 400, alignment: .leading)
.alert(isPresented: $showAlert) {
Alert(title: Text("Validation Error"), message: Text(alertMessage), dismissButton: .default(Text("OK")))
Alert(title: Text("validation_error_message"), message: Text(alertMessage), dismissButton: .default(Text("OK")))
}
}

func saveFields() {
if jsessionID.count == 0 {
alertMessage = "JSESSIONID is a required field. If you don't know where to find this token, please refer to instructions in README.md file on GitHub"
alertMessage = "JSESSIONID" + NSLocalizedString("required_field_error", comment: "Required field")
showAlert = true
return
}
if wmonID.count == 0 {
alertMessage = "WMONID is a required field. If you don't know where to find this token, please refer to instructions in README.md file on GitHub"
alertMessage = "WMONID" + NSLocalizedString("required_field_error", comment: "Required field")
showAlert = true
return
}
if deviceID.count == 0 {
alertMessage = "Device ID is a required field. If you don't know where to find this token, please refer to instructions in README.md file on GitHub"
alertMessage = "Device ID" + NSLocalizedString("required_field_error", comment: "Required field")
showAlert = true
return
}
if !NSPredicate(format: "SELF MATCHES %@", "^[0-9]+$").evaluate(with: deviceID) {
alertMessage = "Device ID must only consist of numbers"
alertMessage = NSLocalizedString("device_id_validation_error", comment: "Device ID must only consist of numbers")
showAlert = true
return
}
Expand Down
6 changes: 5 additions & 1 deletion samsung-pinger/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
<plist version="1.0">
<dict>
<key>ATSApplicationFontsPath</key>
<string>Shared/fonts/</string>
<string>fonts/</string>
<key>UIAppFonts</key>
<array>
<string>samsungsharpsans-bold.otf</string>
<string>samsungsharpsans-medium.otf</string>
</array>
<key>CFBundleDisplayName</key>
<string>Samsung Pinger</string>
<key>CFBundleName</key>
<string>Samsung Pinger</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
Loading

0 comments on commit e050e27

Please sign in to comment.