Commit 1caaa4be authored by Silbino Goncalves Matado's avatar Silbino Goncalves Matado Committed by Romain M.

project: add Walkthrough.strings and LocalizedStringTableNames

Add Walkthrough.strings file for string localization
Add LocalizedStringTableNames struct for NSLocalizedStrings table
names constants

Not created a .string file associated to the storyboard to avoid
switching between multiple files if some strings are defined into
code and others into the storyboard.

Tuleap: #1399
Change-Id: Ie1e88a4413a773daef3be2eb95571d1b842274d0
Reviewed-by: default avatarRomain Bertozzi <romain.bertozzi@savoirfairelinux.com>
parent 351479e5
......@@ -101,6 +101,7 @@
04399B141D1C341A00E99CD9 /* libx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 04399AE21D1C341A00E99CD9 /* libx264.a */; };
04399B151D1C341A00E99CD9 /* libyaml-cpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 04399AE31D1C341A00E99CD9 /* libyaml-cpp.a */; };
5516C29F1E71CEFF009D3D2D /* AccountModelHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5516C29E1E71CEFF009D3D2D /* AccountModelHelper.swift */; };
564C44591E8D7F8F000F92B1 /* LocalizedStringTableNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564C44581E8D7F8F000F92B1 /* LocalizedStringTableNames.swift */; };
56AC64D51E7C7F4000EA1AA9 /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56AC64D41E7C7F4000EA1AA9 /* WelcomeViewController.swift */; };
5557FD4A1E81AE850043E394 /* AccountModelHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5557FD491E81AE850043E394 /* AccountModelHelperTests.swift */; };
5557FD4B1E81AECF0043E394 /* AccountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B22DFA1DF755BB000358C9 /* AccountModel.swift */; };
......@@ -109,6 +110,7 @@
5557FD4E1E81B1F20043E394 /* AccountModelHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5516C29E1E71CEFF009D3D2D /* AccountModelHelper.swift */; };
5557FD4F1E81B2990043E394 /* AccountCredentialsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DD80C91E1EAF1A009A3510 /* AccountCredentialsModel.swift */; };
557086521E8ADB9D001A7CE4 /* SystemAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 557086511E8ADB9D001A7CE4 /* SystemAdapter.mm */; };
56AC64D91E8012CA00EA1AA9 /* Walkthrough.strings in Resources */ = {isa = PBXBuildFile; fileRef = 56AC64DB1E8012CA00EA1AA9 /* Walkthrough.strings */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -237,10 +239,12 @@
04399AE21D1C341A00E99CD9 /* libx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libx264.a; path = ../fat/lib/libx264.a; sourceTree = "<group>"; };
04399AE31D1C341A00E99CD9 /* libyaml-cpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libyaml-cpp.a"; path = "../fat/lib/libyaml-cpp.a"; sourceTree = "<group>"; };
5516C29E1E71CEFF009D3D2D /* AccountModelHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AccountModelHelper.swift; path = Account/AccountModelHelper.swift; sourceTree = "<group>"; };
564C44581E8D7F8F000F92B1 /* LocalizedStringTableNames.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalizedStringTableNames.swift; sourceTree = "<group>"; };
56AC64D41E7C7F4000EA1AA9 /* WelcomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
5557FD491E81AE850043E394 /* AccountModelHelperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountModelHelperTests.swift; sourceTree = "<group>"; };
557086501E8ADB9D001A7CE4 /* SystemAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemAdapter.h; path = Bridging/SystemAdapter.h; sourceTree = "<group>"; };
557086511E8ADB9D001A7CE4 /* SystemAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SystemAdapter.mm; path = Bridging/SystemAdapter.mm; sourceTree = "<group>"; };
56AC64DA1E8012CA00EA1AA9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Walkthrough.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -478,6 +482,8 @@
043999F51D1C2D9D00E99CD9 /* Ring */ = {
isa = PBXGroup;
children = (
564C44571E8D7F68000F92B1 /* Constants */,
56AC64D61E80121200EA1AA9 /* Internationalization */,
0273C3021E0C689600CF00BA /* Walkthrough */,
02EFCACF1E0C3DD600FD8ED1 /* Bridging */,
02E1A0271DDE4C3900D75B59 /* Account */,
......@@ -589,6 +595,22 @@
name = SYS_DEPS;
sourceTree = "<group>";
};
564C44571E8D7F68000F92B1 /* Constants */ = {
isa = PBXGroup;
children = (
564C44581E8D7F8F000F92B1 /* LocalizedStringTableNames.swift */,
);
name = Constants;
sourceTree = "<group>";
};
56AC64D61E80121200EA1AA9 /* Internationalization */ = {
isa = PBXGroup;
children = (
56AC64DB1E8012CA00EA1AA9 /* Walkthrough.strings */,
);
name = Internationalization;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -698,6 +720,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56AC64D91E8012CA00EA1AA9 /* Walkthrough.strings in Resources */,
02B22E031DF755F7000358C9 /* WalkthroughStoryboard.storyboard in Resources */,
04399A061D1C2D9D00E99CD9 /* LaunchScreen.storyboard in Resources */,
04399A031D1C2D9D00E99CD9 /* Assets.xcassets in Resources */,
......@@ -768,6 +791,7 @@
04399AAD1D1C304300E99CD9 /* DRingAdapter.mm in Sources */,
0273C2FF1E0C438F00CF00BA /* AccountAdapterDelegate.swift in Sources */,
02B22DFF1DF755DB000358C9 /* AccountsService.swift in Sources */,
564C44591E8D7F8F000F92B1 /* LocalizedStringTableNames.swift in Sources */,
56AC64D51E7C7F4000EA1AA9 /* WelcomeViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -832,6 +856,14 @@
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
56AC64DB1E8012CA00EA1AA9 /* Walkthrough.strings */ = {
isa = PBXVariantGroup;
children = (
56AC64DA1E8012CA00EA1AA9 /* Base */,
);
name = Walkthrough.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
......@@ -839,6 +871,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
......@@ -887,6 +920,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
......
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
*
* Author: Silbino Gonçalves Matado <silbino.gmatado@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
//Welcome Screen
"WelcomeTitle" = "Welcome to Ring";
"WelcomeText" = "A Ring account allows you to reach people securely in peer to peer through fully distributed network";
"LinkDeviceButton" = "Link this device to an account";
"CreateAccount" = "Create a Ring account";
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
*
* Author: Silbino Gonçalves Matado <silbino.gmatado@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
import Foundation
struct LocalizedStringTableNames {
static let walkthrough = "Walkthrough"
}
/*
* Copyright (C) 2016 Savoir-faire Linux Inc.
* Copyright (C) 2017 Savoir-faire Linux Inc.
*
* Author: Silbino Gonçalves Matado <silbino.gmatado@savoirfairelinux.com>
*
......@@ -30,6 +30,11 @@ class WelcomeViewController: UIViewController {
let createProfileSegueIdentifier = "CreateProfileSegue"
let linkDeviceToAccountSegueIdentifier = "LinkDeviceToAccountSegue"
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: true)
......@@ -54,4 +59,20 @@ class WelcomeViewController: UIViewController {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
self.navigationController?.setNavigationBarHidden(false, animated: true)
}
func setupUI() {
self.welcomeLabel.text = NSLocalizedString("WelcomeTitle",
tableName: LocalizedStringTableNames.walkthrough,
comment: "")
self.descriptionLabel.text = NSLocalizedString("WelcomeText",
tableName: LocalizedStringTableNames.walkthrough,
comment: "")
self.linkDeviceButton.setTitle(NSLocalizedString("LinkDeviceButton",
tableName: LocalizedStringTableNames.walkthrough,
comment: ""), for: .normal)
self.createAccountButton.setTitle(NSLocalizedString("CreateAccount",
tableName: LocalizedStringTableNames.walkthrough,
comment: ""), for: .normal)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment