NativeScript / NativeScript/plugins
Android and iOS Application's language does not match
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 206
- Fork
- 123
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
I have implemented the localize plugin, and Im' facing issues:
"get the default language on user's phone via the language property of the Device class."
I have Android which phone language setting is set United Kingdom (en) this picks up correctly. On iOS I also have the setting language to English as preferred language but this isn't printing correctly. I the following code.
console.log('DEVICE LANGUAGE', device.language);
console.log('From Cores, Device.language);
console.log('from __app__language__', ApplicationSettings.getString('__app__language__'))
const localeOverriddenSuccessfully = overrideLocale(Device.language);
On Android is correct:
On iOS is incorrect:
ns --version
8.5.3
✔ Up to date.
Angular:
ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
Angular CLI: 15.2.8
Node: 20.4.0 (Unsupported)
Package Manager: npm 9.7.2
OS: darwin x64
Angular: 15.1.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1501.6
@angular-devkit/build-angular 15.1.6
@angular-devkit/core 15.1.6
@angular-devkit/schematics 15.2.8
@angular/cli 15.2.8
@ngtools/webpack 15.1.6
@schematics/angular 15.2.8
rxjs 7.6.0
typescript 4.8.4
=============================================
It seems to me that on iOS some how it cached into the the phone's default language variables, earlier on I was manually updating the language like so:
const localeOverriddenSuccessfully = overrideLocale('nl');
could this have been cached for iOS on this variables prior?
device.language
Device.language
__app__language__
Thanks
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện sự khác biệt trên Android và iOS bằng các lệnh gọi Device.language, device.language, ApplicationSettings.getString('app__language') và overrideLocale như đã chỉ ra. So sánh các giá trị được trả về sau khi thay đổi ngôn ngữ thiết bị và sau khi ghi đè locale theo cách thủ công; được xem là hoàn tất khi đã xác định nguyên nhân và hành vi iOS được issue mong đợi đã được sửa hoặc được ghi lại rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, ios, typescript
- Lĩnh vực
- localization, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100