Commit 494933e
committed
Improve localization handling and fix placeholder text update issue
• Localization Enhancements:
• Resolved the issue where the placeholder text in the TextField (“Search Location”) did not update when the app’s language changed at runtime.
• Introduced a selectedLocale property in ContentViewState to manage locale changes manually.
• Injected selectedLocale into the environment using .environment(\.locale, state.selectedLocale) to ensure views react to locale changes.
• Added a language selection view (languageSelectionView) with options for English, Greek, and Albanian, allowing users to switch languages without restarting the app.
• Updated the .id() modifier in locationTextField to use state.selectedLocale.identifier to force re-initialization when the locale changes.
• Date Formatting Improvements:
• Added a formattedDate(format:) method to the DayForecast model to format dates according to the user’s locale.
• Updated the forecast view to display dates in the dd/MM format or according to the current locale settings.
• Resolved Deprecation Warnings:
• Updated the onChange modifiers to use the new closure signatures required in macOS 14.0 and iOS 17.
• Changed single-parameter closures to accept two parameters (newValue and transaction) or zero parameters, as appropriate.
• Localization Files Updated:
• Ensured Localizable.strings files are properly set up with the correct keys and translations for English (en), Greek (el), and Albanian (sq).
• Removed unused or redundant localization entries.
• Updated localization keys in the code to match those in the Localizable.strings files.
• Code Cleanup and Refactoring:
• Removed redundant imports and comments for cleaner code.
• Fixed typos and formatting inconsistencies in several files.
• Updated WeatherManager to use a preferredLocale when reverse geocoding locations to ensure consistency.
• Adjusted font sizes and layout in ForecastView for better UI alignment.
• Improved the handling of optional values and error cases to enhance app stability.
• Version Bump:
• Updated the app version to 1.0.3 to reflect these changes.1 parent 69dfc52 commit 494933e
File tree
7 files changed
+182
-65
lines changed- Moti
- Moti.xcodeproj
- Moti
- Models
- Supporting Files
- ViewModels
- Views
7 files changed
+182
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| |||
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | | - | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | | - | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | | - | |
| 219 | + | |
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
| |||
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
31 | | - | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
36 | | - | |
| 49 | + | |
| 50 | + | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
42 | 62 | | |
43 | 63 | | |
44 | 64 | | |
45 | 65 | | |
46 | 66 | | |
47 | | - | |
| 67 | + | |
48 | 68 | | |
49 | 69 | | |
50 | 70 | | |
51 | 71 | | |
52 | | - | |
| 72 | + | |
53 | 73 | | |
54 | 74 | | |
55 | 75 | | |
56 | 76 | | |
57 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
58 | 84 | | |
59 | 85 | | |
60 | 86 | | |
61 | 87 | | |
62 | 88 | | |
63 | | - | |
| 89 | + | |
64 | 90 | | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
68 | | - | |
69 | | - | |
| 94 | + | |
70 | 95 | | |
71 | 96 | | |
72 | 97 | | |
73 | 98 | | |
74 | | - | |
| 99 | + | |
75 | 100 | | |
76 | 101 | | |
77 | 102 | | |
78 | 103 | | |
79 | 104 | | |
80 | | - | |
| 105 | + | |
81 | 106 | | |
82 | 107 | | |
83 | 108 | | |
84 | 109 | | |
85 | 110 | | |
86 | | - | |
| 111 | + | |
87 | 112 | | |
88 | 113 | | |
89 | 114 | | |
90 | 115 | | |
91 | | - | |
92 | | - | |
| 116 | + | |
93 | 117 | | |
94 | 118 | | |
95 | 119 | | |
96 | 120 | | |
97 | | - | |
| 121 | + | |
98 | 122 | | |
99 | 123 | | |
100 | 124 | | |
101 | 125 | | |
102 | 126 | | |
103 | | - | |
| 127 | + | |
104 | 128 | | |
105 | 129 | | |
106 | 130 | | |
107 | 131 | | |
108 | 132 | | |
109 | | - | |
| 133 | + | |
110 | 134 | | |
111 | 135 | | |
112 | 136 | | |
113 | 137 | | |
114 | | - | |
| 138 | + | |
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
118 | 142 | | |
119 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
120 | 150 | | |
121 | 151 | | |
122 | 152 | | |
123 | 153 | | |
124 | 154 | | |
125 | | - | |
| 155 | + | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
135 | 165 | | |
136 | 166 | | |
137 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
138 | 174 | | |
139 | 175 | | |
140 | 176 | | |
| |||
151 | 187 | | |
152 | 188 | | |
153 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
154 | 196 | | |
155 | 197 | | |
156 | 198 | | |
| |||
208 | 250 | | |
209 | 251 | | |
210 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
211 | 259 | | |
212 | 260 | | |
213 | | - | |
| 261 | + | |
214 | 262 | | |
215 | 263 | | |
216 | 264 | | |
217 | 265 | | |
218 | | - | |
219 | | - | |
| 266 | + | |
| 267 | + | |
220 | 268 | | |
221 | 269 | | |
222 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
226 | 242 | | |
227 | 243 | | |
228 | 244 | | |
| |||
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
234 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
235 | 255 | | |
236 | 256 | | |
237 | 257 | | |
| |||
0 commit comments