Open ayangweb opened 11 months ago
get user-agent info inside the javascript code ?
What precisely do you mean by "switch the language"? Is the issue that you initially told create-tauri-app that you wanted to use JavaScript for the front-end, but now want to use Rust (or vice versa)?
If so, it seems like you'd be better of recreating the project from scratch, then copy over the few files that didn't depend on that language. Or am I missing something?
What precisely do you mean by "switch the language"? Is the issue that you initially told create-tauri-app that you wanted to use JavaScript for the front-end, but now want to use Rust (or vice versa)?
If so, it seems like you'd be better of recreating the project from scratch, then copy over the few files that didn't depend on that language. Or am I missing something?
I have a button that switches between Chinese and English, and the content on the page can be switched normally, but how can I switch the language of the window at the same time?
Chinese:
English:
Currently I can only write the following information in info.plist
before I can achieve the above effect, and it is not possible to switch it at any time with a button, so how can I achieve it in other ways?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>Chinese</string>
</dict>
</plist>
get user-agent info inside the javascript code ?
I'm sorry to get back to you so late, have you ever realized this? Can you share? Thank you!
What precisely do you mean by "switch the language"? Is the issue that you initially told create-tauri-app that you wanted to use JavaScript for the front-end, but now want to use Rust (or vice versa)? If so, it seems like you'd be better of recreating the project from scratch, then copy over the few files that didn't depend on that language. Or am I missing something?
I have a button that switches between Chinese and English, and the content on the page can be switched normally, but how can I switch the language of the window at the same time?
Chinese:
English:
Currently I can only write the following information in
info.plist
before I can achieve the above effect, and it is not possible to switch it at any time with a button, so how can I achieve it in other ways?<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>Chinese</string> </dict> </plist>
The i18n for native iOS/macOS development,Just config CFBundleDevelopmentRegion like this, I'm not test it in tauri, but I think it will work.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
</dict>
</plist>
BTW: The default name is Info.plist
, not info.plist
, if not work, try to change filename.
Describe the problem
I want to change the default language of the app and then dynamically switch the language of the app, how should I do it?
Describe the solution you'd like
I hope this solves my confusion!
Alternatives considered
No response
Additional context
No response