Skip to content

Commit de8525f

Browse files
committed
[#707] Add localization-ready structure
1 parent 3a4b487 commit de8525f

6 files changed

Lines changed: 172 additions & 16 deletions

File tree

template/Tuist/Interfaces/SwiftUI/Sources/Presentation/Modules/ForceUpdate/ForceUpdateView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ struct ForceUpdateView: View {
1313
Image(systemName: "arrow.up.circle")
1414
.font(.system(size: 64))
1515
.foregroundStyle(Color.accentColor)
16-
Text("Update Required")
16+
Text("force_update.title")
1717
.font(.title.bold())
18-
Text("A new version of the app is required to continue. Please update to the latest version.")
18+
Text("force_update.message")
1919
.multilineTextAlignment(.center)
2020
.foregroundStyle(.secondary)
21-
Button("Update Now", action: onUpdate)
21+
Button("force_update.button.update_now", action: onUpdate)
2222
.buttonStyle(.borderedProminent)
2323
}
2424
.padding()

template/Tuist/Interfaces/SwiftUI/Sources/Presentation/Modules/Home/HomeView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ struct HomeView: View {
1111
Image(systemName: "person.crop.circle.badge.checkmark")
1212
.font(.system(size: 48))
1313
.foregroundColor(.accentColor)
14-
Text("Signed In")
14+
Text("home.title")
1515
.font(.title2.bold())
16-
Text("This starter flow demonstrates the signed-in state that teams can build on with product-specific screens.")
16+
Text("home.message")
1717
.multilineTextAlignment(.center)
1818
.foregroundStyle(.secondary)
1919

20-
Button("Open Settings", action: onShowSettings)
20+
Button("home.button.open_settings", action: onShowSettings)
2121
.buttonStyle(.bordered)
2222

23-
Button("Present Settings Full Screen", action: onPresentSettings)
23+
Button("home.button.present_settings_full_screen", action: onPresentSettings)
2424
.buttonStyle(.bordered)
2525

26-
Button("Sign Out", action: onSignOut)
26+
Button("home.button.sign_out", action: onSignOut)
2727
.buttonStyle(.borderedProminent)
2828
}
2929
.padding()

template/Tuist/Interfaces/SwiftUI/Sources/Presentation/Modules/Landing/LandingView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct LandingView: View {
1616
Group {
1717
switch viewModel.state {
1818
case .loading:
19-
Color.clear
19+
ProgressView("landing.loading.restore_session")
2020
.frame(maxWidth: .infinity, maxHeight: .infinity)
2121
case .signedOut:
2222
SignOutView(onContinue: continueWithDemoSession)
@@ -80,7 +80,7 @@ struct LandingView: View {
8080
destination(for: route)
8181
.toolbar {
8282
ToolbarItem(placement: .cancellationAction) {
83-
Button("Close", action: router.dismissFullScreen)
83+
Button("common.button.close", action: router.dismissFullScreen)
8484
}
8585
}
8686
}

template/Tuist/Interfaces/SwiftUI/Sources/Presentation/Modules/Settings/SettingsView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ struct SettingsView: View {
77
Image(systemName: "gearshape")
88
.font(.system(size: 48))
99
.foregroundColor(.accentColor)
10-
Text("Settings")
10+
Text("settings.title")
1111
.font(.title2.bold())
12-
Text("This placeholder route gives generated apps a native NavigationStack destination to extend.")
12+
Text("settings.message")
1313
.multilineTextAlignment(.center)
1414
.foregroundStyle(.secondary)
1515
}
1616
.padding()
17-
.navigationTitle("Settings")
17+
.navigationTitle("settings.title")
1818
}
1919
}

template/Tuist/Interfaces/SwiftUI/Sources/Presentation/Modules/SignOut/SignOutView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ struct SignOutView: View {
99
Image(systemName: "person.crop.circle.badge.exclamationmark")
1010
.font(.system(size: 48))
1111
.foregroundColor(.accentColor)
12-
Text("Signed Out")
12+
Text("sign_out.title")
1313
.font(.title2.bold())
14-
Text("A generated project now starts from an unauthenticated state and can transition into a signed-in flow with a local demo session.")
14+
Text("sign_out.message")
1515
.multilineTextAlignment(.center)
1616
.foregroundStyle(.secondary)
1717

18-
Button("Continue with Demo Session", action: onContinue)
18+
Button("sign_out.button.continue_demo_session", action: onContinue)
1919
.buttonStyle(.borderedProminent)
2020
}
2121
.padding()
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"sourceLanguage" : "en",
3+
"strings" : {
4+
"common.button.close" : {
5+
"localizations" : {
6+
"en" : {
7+
"stringUnit" : {
8+
"state" : "translated",
9+
"value" : "Close"
10+
}
11+
}
12+
}
13+
},
14+
"force_update.button.update_now" : {
15+
"localizations" : {
16+
"en" : {
17+
"stringUnit" : {
18+
"state" : "translated",
19+
"value" : "Update Now"
20+
}
21+
}
22+
}
23+
},
24+
"force_update.message" : {
25+
"localizations" : {
26+
"en" : {
27+
"stringUnit" : {
28+
"state" : "translated",
29+
"value" : "A new version of the app is required to continue. Please update to the latest version."
30+
}
31+
}
32+
}
33+
},
34+
"force_update.title" : {
35+
"localizations" : {
36+
"en" : {
37+
"stringUnit" : {
38+
"state" : "translated",
39+
"value" : "Update Required"
40+
}
41+
}
42+
}
43+
},
44+
"home.button.open_settings" : {
45+
"localizations" : {
46+
"en" : {
47+
"stringUnit" : {
48+
"state" : "translated",
49+
"value" : "Open Settings"
50+
}
51+
}
52+
}
53+
},
54+
"home.button.present_settings_full_screen" : {
55+
"localizations" : {
56+
"en" : {
57+
"stringUnit" : {
58+
"state" : "translated",
59+
"value" : "Present Settings Full Screen"
60+
}
61+
}
62+
}
63+
},
64+
"home.button.sign_out" : {
65+
"localizations" : {
66+
"en" : {
67+
"stringUnit" : {
68+
"state" : "translated",
69+
"value" : "Sign Out"
70+
}
71+
}
72+
}
73+
},
74+
"home.message" : {
75+
"localizations" : {
76+
"en" : {
77+
"stringUnit" : {
78+
"state" : "translated",
79+
"value" : "This starter flow demonstrates the signed-in state that teams can build on with product-specific screens."
80+
}
81+
}
82+
}
83+
},
84+
"home.title" : {
85+
"localizations" : {
86+
"en" : {
87+
"stringUnit" : {
88+
"state" : "translated",
89+
"value" : "Signed In"
90+
}
91+
}
92+
}
93+
},
94+
"landing.loading.restore_session" : {
95+
"localizations" : {
96+
"en" : {
97+
"stringUnit" : {
98+
"state" : "translated",
99+
"value" : "Restoring session..."
100+
}
101+
}
102+
}
103+
},
104+
"settings.message" : {
105+
"localizations" : {
106+
"en" : {
107+
"stringUnit" : {
108+
"state" : "translated",
109+
"value" : "This placeholder route gives generated apps a native NavigationStack destination to extend."
110+
}
111+
}
112+
}
113+
},
114+
"settings.title" : {
115+
"localizations" : {
116+
"en" : {
117+
"stringUnit" : {
118+
"state" : "translated",
119+
"value" : "Settings"
120+
}
121+
}
122+
}
123+
},
124+
"sign_out.button.continue_demo_session" : {
125+
"localizations" : {
126+
"en" : {
127+
"stringUnit" : {
128+
"state" : "translated",
129+
"value" : "Continue with Demo Session"
130+
}
131+
}
132+
}
133+
},
134+
"sign_out.message" : {
135+
"localizations" : {
136+
"en" : {
137+
"stringUnit" : {
138+
"state" : "translated",
139+
"value" : "A generated project now starts from an unauthenticated state and can transition into a signed-in flow with a local demo session."
140+
}
141+
}
142+
}
143+
},
144+
"sign_out.title" : {
145+
"localizations" : {
146+
"en" : {
147+
"stringUnit" : {
148+
"state" : "translated",
149+
"value" : "Signed Out"
150+
}
151+
}
152+
}
153+
}
154+
},
155+
"version" : "1.0"
156+
}

0 commit comments

Comments
 (0)