409 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
129
views
What is the best way to find all user facing text in an iOS app for localization?
I have an older objective-C iOS project with thousands of strings, both user facing and internal, that is not localized.
My main challenge is to identify user facing text that are string literals in ...
5
votes
1
answer
815
views
Localizing plurals when the number is not included in the text
What is the correct way to localize and pluralize a string when the number is not included in the text?
I know I can do the following with AttributedString (already a great feature):
var count = 3
...
0
votes
1
answer
614
views
How do I localize a string that contains a date and the location of the text differs depending on the language?
I'm localizing my app for Hungarian users and having trouble figuring out how to handle a string with a date in it.
In English, I have a text string that should say "4 reps @ 120 kg on 8/19/23&...
0
votes
1
answer
1k
views
How to concatenate different localized string keys into one in SwiftUI
I have a variable that I am interpolating into a Text view:
struct Example : View {
var example : String?
var body : some View {
ZStack {
Text("Example text: \(example ?? "")&...
0
votes
1
answer
917
views
Localized .strings file in a bundle return en.lrproj, even when running in non-English language. Using the same file directly without bundle works
I'm currently working on an iOS project in Xcode where I've created a resource bundle containing a translated .strings file (let's call it myTexts.strings). This bundle is then reused in multiple ...
0
votes
1
answer
156
views
Is there any way to get localizations from iOS?
If I show an alert without any buttons, a default button is "OK". In Korean iOS it is "확인" and in Japanese it is "OK" as well.
So if I can refer localizations from iOS, ...
6
votes
1
answer
585
views
Possible iOS 16 bug in NSLocalizedString passing from Swift to Objective-C
I've encountered what I think is a bug in iOS16: When a localized string is passed from Swift to Objective-C and compared with another identical localized string (defined in Objective-CC), the result ...
2
votes
1
answer
1k
views
Static NSLocalizedString causes "one-time initialization function" crash only on iOS16
We usually define NSLocalizedString as static variables in a String extension such as:
extension String {
static let text = NSLocalizedString("text_key", tableName: "Translations&...
2
votes
1
answer
357
views
NSLocalizedString with a Double and a specifier
I tried a lot of possibilities to specify only "2 digits" after the "." for this Double without success.
I don't know where to add , specifier: "%.2f".
// ContentView....
0
votes
1
answer
76
views
iOS user with language of "en", no region code, translation lookup fails
We have a bug reported where a user has a device with an en language and nil region code, and thus all NSLocalizedString lookups in are failing, meaning our string key is what is rendered onscreen. ...
0
votes
2
answers
153
views
Print NSLocalizedString key instead of value
I need to print the keys of Localizable.strings in my App, instead of their values (for a debugging purpose). Is there a fast way to override the NSLocalizedString() method or redefine the macro, ...
0
votes
1
answer
2k
views
Check existence of localized string in .strings resource file, fall back to default
I want to find the appropriate localized string based on some runtime variable and fall back to a default string:
// localizable.strings
"com.myapp.text1" = "The default text 1&...
0
votes
3
answers
2k
views
NSLocalizedString and value with SwiftUI
I'm trying to localize a Text view with a value inside without success!
Here's what I'm usually do:
// ContentView.swift
Text("Tomato")
/* replaced by */
Text(NSLocalizedString("text-...
1
vote
2
answers
3k
views
How to use interpolation with strings that rely on automatic grammar agreement?
I'm trying to solve a seemingly simple issue: display free trial terms to the user in SwiftUI Text view. I have a unit string set to "Week" and a value that I can switch from 1 to 2. To ...
1
vote
1
answer
270
views
UIPasteboard showing Paste keyword in English language
In my app when I tried to open UIPasteboard after copying text it's showing Paste text in the English language. While other option texts are in Japanese!
It's not same behavior for all device. In some ...