app-i18n | app的国际化处理脚本,可以将翻译文档一键转换成Android以及iOS的格式 | iOS library
kandi X-RAY | app-i18n Summary
kandi X-RAY | app-i18n Summary
app的国际化处理脚本,可以将翻译文档一键转换成Android以及iOS的格式
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Start transform
- Build the translated file
- Parse an xls file
- Parse xlsx file
- Generate text for given language
- Generate the XML for a given language
- Parse text file
- Edit language description
app-i18n Key Features
app-i18n Examples and Code Snippets
Community Discussions
Trending Discussions on app-i18n
QUESTION
Example repo
The repo can be found here.
Please note that this isn't a complete example, it is merely there to show issues around testing $localize
.
There are 2 branches:
1. master
1. enable-localize-unit-tests
- this changes the test.ts
and polyfills.ts
to prevent the @angular/localize/init
from being imported, the $localize
global function is also spied
Overview
I have upgraded a project from Angular 8 to 9 (following the Angular update guide), replacing any usage the I18n
service (from the ngx-translation/i18n-polyfill) with Angular's new $localize
function (documentation on this is pretty limited, here is the best I could find). I can run localised builds and serve the application in a particular locale again. However, I've hit a bit of a roadblock when it comes to unit testing.
Previously, when using the i18n-polyfill
, the I18n
service could be injected into components, etc. as follows (see I18nPolyfillComponent
):
ANSWER
Answered 2020-Mar-26 at 15:18The solution that I found was to spy on the translate
function of $localize
rather than $localize
itself:
test.ts
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install app-i18n
You can use app-i18n like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page