Comments (3)
Hi @paulgessinger! Thanks for the suggestion.. This is something that I thought about, but in the end I decided that it's not the best option when working with Strings Catalogs for a couple of reasons...
-
It's quite complicated (but not impossible) to have to figure out the hierarchy and then generate additional structs and properties to define the constants and I didn't want to have to write that code 😄
-
As I understood it, one of the recommendations from Apple is to use multiple Strings Catalogs to break out localizations into specific groups and if you were to follow this guidance it ends up working quite well with this tool because you can end up with something like this:
Text(.settings.title) // ‘title‘ from ‘Settings.xcstrings‘
Since the constants already manage mapping to the correct strings table for you, as you can see from above, it's very easy to work with strings from across multiple tables.
Additionally, it's just a hunch, but I think splitting strings across multiple catalogs will eventually end up becoming more popular since a single .xcstrings file contains all of your localizations as well, which is going to mean that the file grows in size relatively quickly (I got some insight on this in #26) and might end up being hard to work with if it's too large.
Do you think that multiple Strings Catalog files would work for you? It would be interesting to know if there are any blockers to that as we might be able to find solutions to them to make it a more convenient option 🙇
from xcstrings-tool.
Actually, I didn't consider the possibility of using multiple catalogs at all. That seems like a way to make this more manageable and also provide scoping.
from xcstrings-tool.
Yeah, I think coming from .strings, where it was just one Localizable.strings to rule them all (at least it was for every project that I worked on before), it's not the first thing to come to your mind. Especially when you end up with one Localizable.strings for every language 😅
Using multiple catalogs isn't something that i've done myself yet, so i'd be keen to hear how it goes.. I hope there aren't any issues but let me know if there are 🤞
from xcstrings-tool.
Related Issues (20)
- Keys which are Swift keywords can't be compiled HOT 1
- Add public for package HOT 2
- Sendable conformance HOT 7
- Integrating XCStrings Tool into a Swift Package Target has wrong package git url HOT 2
- ExtractionState config HOT 3
- 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 2
- Duplicate accessors generated in extensions on both `String` and `LocalizedStringResource`
- Support deferred formatting
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.