Comments (4)
ACTIVE_ENERGY_TITLE_EMBEDDED
key is defined in Localizable-DataTypes.strings
So you need to specify tableNeme
"Localizable-DataTypes"
.
let bundle = Bundle(for: HKWorkout.self)
let string = NSLocalizedString("ACTIVE_ENERGY_TITLE_EMBEDDED", tableName: "Localizable-DataTypes", bundle: bundle, value: "", comment: "")
The above code should return "Active Energy"
string.
I only check on a simulator, but on a device should work as same.
from applelocalization-web.
That makes perfect sense! Thank you very much @kishikawakatsumi, I appreciate your help.
I actually have a follow up question, I am also trying to get the strings for the HKWorkoutActivityType
enum, eg "Basketball"
I notice that HKWorkoutActivityTypeBasketball
it's in FitnessUI.framework
which is private, so I guess I can't use that.
I notice also that it's in HealthUI.framework
but I can't see that, only HealthKitUI.framework
, maybe it's also private?
from applelocalization-web.
Yes, HealthUI.framework
is a private framework. If you'd like to access the bundle, you can use Bundle(path:)
initializer. Like the following:
let bundle = Bundle(path: "/System/Library/PrivateFrameworks/HealthUI.framework")!
let string = NSLocalizedString("HKWorkoutActivityTypeBasketball", tableName: "HealthUI-Localizable", bundle: bundle, value: "", comment: "")
^ this should show "Baseball"
string. It should work only on a device. Because a simulator runs on host's file system.
from applelocalization-web.
Oh yeah it works, you're the best. Thanks again!
from applelocalization-web.
Related Issues (7)
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 applelocalization-web.