Hey,
I'm trying the new strings catalog, and I have a script that I would like to run on the xcstrings json.
My question is there some documentation on the json format (what keys can it have, and values)?
Also, I didn't try it yet, but what if I set for example 50 languages and 1000 localization keys, is that json really scalable? It could grow quite large, would xcode still keep it as one big file, or it would somehow split it into chunks?
Would be happy for any info from the dev teams, thanks!
Post not yet marked as solved
String catalog is a great new feature to organize strings in one place. What would you recommend how to handle extracted Strings which need not be translated in different languages
Hello, do the String Catalogs (new in Xcode 15) support Swift Packages?
I've tried adding a new Localizable.xcstrings (string catalog) file to my package's resources folder.
Great! I then see this screen:
All good so far.
I then try to go and build my Swift Package... and nothing changes. The string catalog is never populated and I'm left with the same screen as above.
So, do string catalogs not support packages at this time or am I doing something wrong?
I was really hoping String Catalogs would work and save the day since Export Localizations also does not work for Swift packages that don't support macOS. 😔
When the "Use compiler to Extract Swift Strings" is set to true, it extracts strings from the frameworks i have imported as well. How can i avoid this?
Post not yet marked as solved
Hi, still without any success I can’t recreate the ui tests that will highlights the string in the screenshot like it’s shown in WWDC 2019 - 403.
I even submitted feedback via Feedback Assistant 3 months ago. FB12284285
https://developer.apple.com/videos/play/wwdc2019/403/
I would love to see this finally works with string catalogs.
Thanks
Why is the custom localized string macro name only allowed for Objective C and C code? I have a wrapper class for localization which is a Swift function. I'm unable to get the strings i pass to it localized. Is there any way to get it working other than writing an objective C class and adding it to the bridging header?
Post not yet marked as solved
I am typing string text on textDocumentProxy in a custom keyboard app. The input text includes newlines and punctuation letters, but when I try to edit the textDocumentProxy field, the textDocumentProxy.documentContextBeforeInput in case a newline \n is included, it does not return full content before input.
I placed the cursor on after the good morning word center, I got only good string text. The remaining "hi folks", words do not return.
Here are some examples I have tried.
var inputText = "Hi folks,
Good morning to everyone "
var txtBeforeCursor = textDocumentProxy.documentContextBeforeInput ?? ""
print("Before Cursor text : ",txtBeforeCursor)
Output is:
Before Cursor text : Good
I have an App with multiple string catalogs.
I mistyped the name of a table in one of my
String(localized: "Some English Text", table "nonExistingTable") instances.
I did not receive a compile-time warning telling me the table was missing and my application defaulted to the English text instead. Is this expected behaviour or a bug?
Our app is not localized but we want to begin the localization process starting with push notifications we are going to integrate. The documentation notes:
you can store your message strings in the Localizable.strings file of your app bundle and use the title-loc-key, subtitle-loc-key, and loc-key payload keys to specify which strings you want to display
String Catalogs in Xcode 15 supersedes Localizable.strings. How do you support this when using String Catalogs? Do you just manually add a Localizable.xcstrings file to your project then manually add a new entry for your loc-key, and the system will find this string without issue? Or will we need to have a Localizable.strings file too?
Post not yet marked as solved
I have English as the base language but I also support English (UK) which defines a few UK specific localizations but should fall back to English for everything else.
The way I have it now, all my fallback strings are in "New" state in the UK localization, ie they don't have a UK specific string. This actually works, but UK completion is at 5% and I can't find a way to tell it that the rest are OK to be taken from the base language. By keeping a lot of "New" strings, the tool won't be helping me when I add more strings to the base language.
Marking those as Reviewed creates a blank string localization which is obviously not what I need.
BTW if marking as reviewed would help here, it would be a pain because it has to be done one by one, I can't multi select.
Post not yet marked as solved
I migrated to String Catalog in my app.
That worked fine, and everything is OK in the Simulator and even on a real device.
However, After I deployed the App and it became available in the AppStore, I started receiving Feedback from some users. Seems my app is no longer doing localization. It always presents itself in its development language.
Has anyone else experienced this?
Post not yet marked as solved
My app has the Text views that display the value of variables.
Below are two sample pieces of code and the String Catalog (Localizable.xcstrings) entries created when app builds:
(1) Code: Text("[ (var1) ]")
Key: [ %@ ]
Default: [ %@ ]
Spanish: [ %@ ]
(2) Code: Text("(var2) - (var3) - (var4)")
Key: %@ / %@ / %@
Default: %1$@ / %2$@ / %3$@
Spanish: %1$@ / %2$@ / %3$@
Each of the 4 vars have a discrete number of known possible values.
How do I enter the possible var values and their associated Spanish translations in the String Catalog?
Post not yet marked as solved
When adding a new language I added something I don't intend on supporting however you are unable to delete an added language once added.
Yes, I could edit the file as source code and remove all the e.g. de-DE references but that shouldn't be needed.
Edit: Submitted this as feedback via FB12576340
Post not yet marked as solved
Hi,
I've been using string files to localize incoming remote notifications like this:
"training_new_title" = "New training added";
"training_new_body" = "A new training on %@ has been added";
Following the migration to the new string dicts it looks like this:
"training_new_body" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "A new training on %@ has been added"
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Een nieuwe training op %@ is toegevoegd"
}
}
}
},
"training_new_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "New training added"
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nieuwe training toegevoegd"
}
}
}
},
Unfortunately as said before notifications are no longer localized and come in as their normal state: "training_new_title" & "training_new_body" .
I am using Firebase messaging service, they send a APNS, that looks like this:
notification: {
titleLocKey: "training_new_title",
bodyLocKey: "training_new_body",
bodyLocArgs: bodyPayload,
}
Do string dicts require any extra steps apart from the standard that I have implemented?
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
completionHandler(.newData)
}
Thanks in advance for any insights
Post not yet marked as solved
I have a string catalog of over a 1000 strings. How do i export only the strings that need to be reviewed and not the whole catalog?
Post not yet marked as solved
In my project I have 3 targets. A macOS target, a target for iPhone and a target for iPad.
The macOS App has an own Localizable file and I have been able to convert this to string catalog without any issues. I like this catalog!
But when I try to convert the Localizable file that is shared between 2 targets, then targets fail to compile afterwards with the following error message:
...mul.lproj/Localizable.xcstrings:1:1 Localizable.xcstrings cannot co-exist with other .strings or .stringsdict tables with the same name.
Does anybody have an idea how I can resolve this? Do I need to keep individual copies of the Localizable file for these 2 targets?
Post not yet marked as solved
We use a localization service that allows us to export our translated strings in .xliff format. When I import the spanish (es.xliff) file into the string catalogs it imports the english keys and leaves the spanish translation column empty, which causes it to default to English.
I created feedback 12429535 and 12429469 because it seems the feedback site is broken and shows it cannot find the feedback I just submitted.
Post not yet marked as solved
Seems like a bug on the Xcode 15.0 beta.
Steps to reproduce:
Create a new empty Static Library project in Xcode (objective-C)
Add a String Catalog file
Add a dummy function which includes NSString *str = NSLocalizeString(@"test string", @"comment");
Build the project.
Result: String Catalog is empty while it should be updated with "test string".
I submitted FB12408229
Anyone encountered this? Anyone from Apple can kindly confirm?
Post not yet marked as solved
Is it possible to merge or split a string catalog? It doesn't seem possible now.
The workaround i use now is eidting the xcstrings file in TextEdit.
Post not yet marked as solved
Migrating from localizable.strings to string catalog is simple. After migrating the state of 55% are checked okay, 45% are marked with state "new". Why happens this? Reviewing the new strings and marking as "reviewed" would now mean to change each of the 60 "new" marked rows x 4 languages manually - a lot of work. Is there a way to group change the states of all strings?