All Questions
Tagged with localization swift
584
questions
0
votes
0
answers
15
views
Generic enum with localized string in SwiftUI [duplicate]
I'd like to have a function that can take both enum A and enum B and display the raw values in a menu. so i use type T to make the function generic, and T follows the localized protocol i defined so ...
-1
votes
0
answers
49
views
How to localize credits.rtf in Xcode
I want to localize the content of the credit.rtf file in Xcode, that is used in the about box of macOS applications. I am using string catalog files for the localization of my Swift application.
0
votes
0
answers
118
views
XCode localizable.xcstrings - key with parameters
I'm new to XCode and iOS app development and I'm struggling with the localizations strings. I'm using XCode Version 15.3 and would like to know how to use a key with 2 or more parameters in the ...
1
vote
3
answers
198
views
How to Manually Track a Custom Key That Involves Interpolation in String Catalog (Localizable.xcstrings)
In SwiftUI (although this question may apply to a wider domain than that),
If you are localizing your app with the latest methods, then you are using String Catalogs (Localizable.xcstrings)
Normally (...
1
vote
1
answer
98
views
How to get String Catalog to work with Swift Enum's Raw Values?
In SwiftUI I have a Picker (based on UISegmentedControl) that uses an enum for the cases (and strings) that it displays like so:
enum DayRange: String, CaseIterable, Identifiable {
case fourteen = ...
0
votes
0
answers
50
views
How would I load images for a custom local on iOS?
I want to add localization which can be controlled during runtime from within the app. I want to use Apple's localization solution for strings/colors/images. For strings, the issue is quite simple, I ...
0
votes
1
answer
163
views
Swift Localizable.xcstrings inheritance
I have a Xcode project with multiple targets.
This targets have common translations and some specific ones.
Is there a way to handle some kind of localization inheritance so if it does find a ...
0
votes
2
answers
47
views
How to localize conditional String
I'm currently localizing my app from English to German. However, I've encountered difficulties when localizing conditional operators like this one:
Text("Status: \(bluetoothManager.isConnected ? &...
0
votes
0
answers
35
views
Incorrect display of country names on iPhone
After updating IOS from 17.1.2 to 17.4.1, the display of some countries in TableView changed, for example, Taiwan became Root(Taiwn), Macau also became Root(Makao) and the same with Hong Kong and ...
0
votes
0
answers
22
views
Translate output of function in Swift [duplicate]
I'm struggling to translate the output of a function which dynamically creates a string to then display on the view.
The function is the following:
func displayDateText(date: Date, weekNumber: Int, ...
0
votes
0
answers
43
views
Does anyone have any idea why my right-to-left (RTL) layout isn't taking effect immediately?
I'm working on integrating RTL (right-to-left) and LTR (left-to-right) layouts into my application, and everything seems to be functioning properly. However, I've encountered an issue: when I ...
0
votes
1
answer
49
views
Swift Sort string array with german localization
I am sorting an array of Strings in alphabetical order (first two letters) for a tableview and don't know how to sort with german localization.
When changing localization to german in xcode the sort ...
0
votes
0
answers
23
views
Change NSDoubleLocalizedStrings at runtime
In Xcode, I can alter a scheme's App Language to be "Double-length Pseudolanguage" and it will launch with all strings doubled. I'd like to be able to change this at runtime so I can turn it ...
0
votes
0
answers
107
views
Create a localized string with a generated comment
My framework contains a protocol that allows conforming types to describe themselves. One of its requirements is a static member containing the name of the type. This can be used as (for example) the ...
0
votes
1
answer
155
views
In Xcode and SwiftUI how to avoid strings used in Previews being written to Localizable.xcstrings?
I have a bunch of custom views. Below is a minimal example:
struct PairView: View {
let left: String
let right: String
var body: some View {
HStack(alignment: .firstTextBaseline) {
...