Comments (3)
Thanks for reporting this! This is an interesting issue 🤔 It seems that Xcode will consider a string with a missing extractionState
as automatically managed:
![Screenshot 2024-03-28 at 13 04 45](https://private-user-images.githubusercontent.com/482871/317718297-fc7b48f2-73ff-4139-8f6c-ea77af7be10b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwMDQzMjMsIm5iZiI6MTcyMDAwNDAyMywicGF0aCI6Ii80ODI4NzEvMzE3NzE4Mjk3LWZjN2I0OGYyLTczZmYtNDEzOS04ZjZjLWVhNzdhZjdiZTEwYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwM1QxMDUzNDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iNDhhMmEzNGQxZjcwMDg5NTk0NWM5Nzg4YjQ4ZGEyNDVmNWRjODYyZjVmMDMwNTExYmI5MmNmZjRiNTQ3N2M4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._vGjw0BPNsMKcy0vspOZBsdATunsY-fcRqUoB__Qnjs)
The reason that we skip/warn about Automatically managed strings is that there is potential for Xcode to see the generated definition try to update the source in the Strings Catalogs (essentially overwriting what you have defined) which is something that we want to avoid.
Before going down the route of overriding this, could you confirm if you have spoken with your translation platform about this? I would expect that the value should be either preserved from upload, or set to manual
if your generating a Strings Catalog from phrases that are defined in the platform directly.
As a temporary workaround, you could use jq
to post-process the file after downloading:
jq --indent 2 '.strings |= map_values(if has("extractionState") then . else {"extractionState": "manual"} + . end)' Localizable.xcstrings > Localizable.xcstrings.tmp && mv Localizable.xcstrings.tmp Localizable.xcstrings
from xcstrings-tool.
Thanks for workaround.
I have already contacted team of online tool, to set this field to manual
or provide option to configure it.
However, there might be others edge cases with this field.
I believe this should be an easy fix on tool side. For example some static variable (array?) with StringExtractionState value to ignore/warning probably?
from xcstrings-tool.
It's relatively easy to add configuration options to the CLI, but there isn't really a good way to pass flags through when using the Package Plugin (I don't encourage the usage of the CLI directly atm).
I'm interested to see which other scenarios where the extractionState
is set to something other than manual
or automatic
to understand if the customisation would be the appropriate way to handle it or not
from xcstrings-tool.
Related Issues (20)
- Integrating XCStrings Tool into a Swift Package Target has wrong package git url HOT 2
- Demonstrate use of language overrides in documentation HOT 3
- Feature Suggestion: Support to other build systems HOT 1
- Default values with UnsafeRawPointers do not compile HOT 4
- Ensure that snapshots compile
- Multiple commands produce generated source when working with embedded watchOS app HOT 5
- Generate.swift in the Release files look different HOT 3
- Support SwiftSyntax 5.10
- Improve SwiftUI support on iOS 15 HOT 16
- String containing a single `%` is parsed incorrectly HOT 1
- Duplicates in Localizable.xcstrings in 0.2.0 HOT 9
- Set default value to be fallback documenting comment HOT 2
- Suggestion/Question init LocalizedStringKey with .localizable.key HOT 8
- How to use with Github Actions? HOT 3
- Duplicate accessors generated in extensions on both `String` and `LocalizedStringResource`
- Support deferred formatting
- Generated @available has trailing whitespace HOT 5
- Build errors after updating from 0.4.1 to higher version HOT 3
- Add note to documentation about unwanted target dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcstrings-tool.