-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation of localization packages and manager. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 46 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
b8a5c77
feat(*): Initial implementation of localization packages and manager.
skrustev e84bece
feat(localization): Add date custom formatting matching with Intl as …
skrustev 346c4b4
feat(manager): Add lang tag support check and observer.
skrustev a62842a
fix(resources): Set type for all resource strings, so they reference …
skrustev 897fbe7
fix(resources): Add .js extension to imports of resource string objec…
skrustev 2e0fe0a
feat(core): Add getter for currency symbol.
skrustev 84fa6a1
fix(core): Fix incorrect naming for event args.
skrustev 9f3fb83
feat(core): Add first day of week Intl implementation.
skrustev 9559e12
feat(core): Add currency symbol position implementation.
skrustev 0a2d6cb
feat(core): Add ability to register resource, without overriding curr…
skrustev 7590023
feat(core): Remove overide options from registering resources, becaus…
skrustev 69e7377
chore(*): Remove igniteui-angular-i18n package since it will be still…
skrustev 562f9c3
feat(*): Add linting and nodejs test runner.
skrustev c35d4bb
fix(core): Fix lint errors based on lint report.
skrustev 3fecd95
feat(core): Use single variable for default locale and make locale ar…
skrustev 7f4a7b0
feat(core): Switch to vitest for native browser testing capabilities.…
skrustev 0671089
tests(core): Add test automation. Few fixes related to tests.
skrustev 5008b08
fix(core): Bring back deleted lint config and fix build.
skrustev a80f408
feat(*): Add readme, templates and workflows for the repo.
skrustev fc1484f
feat(*): Use gulp to copy packages.
skrustev aff5903
fix(lint): Exclude gulpfile from lint.
skrustev 7a896c1
fix(*): Add playwright install notes and workflow.
skrustev 487d4fc
chore(*): Remove Azure badge.
skrustev 5f61ca5
chore(*): Fix readme badge format
skrustev 564e60a
feat(*): Apply new resources changes from igniteui-angular.
skrustev b6deceb
feat(core): Make getting date time formatter public and cover Date er…
skrustev 9a93791
chore(*): Add missing doc.
skrustev f4246b3
fix(core): Extend native Event Target for handling internal events. R…
skrustev 77d82de
fix(core): Various checks and tweaks to make sure there are no errors…
skrustev 452d485
tests(core): Update tests to reflect latest changes.
skrustev 871a728
fix(core): Apply missing sort to locale options key formatting.
skrustev 7955083
chore(*): Format method
skrustev c9c553e
feat(core): Add date time format getter and add cases for h11 and fix…
skrustev 6eb05dd
feat(core): Save resource strings based on locale language.
skrustev fbddf3e
feat(date-picker): Update resources with latest changes from master.
skrustev c2460e0
fix(core): SSR related fixes and increas max event listeners for the …
skrustev 7ea75d4
chore(core): Small note on max listeners.
skrustev 42ec007
fix(core): Better check for event inheritance and fix tests missing n…
skrustev 05005e1
fix(core): Fix extension not added for utils.
skrustev 4a71c8e
fix(core): Fix day period being uppercase.
skrustev 9a8ae25
feat(core): Add ability to disable event triggering due to Angular is…
skrustev ec4865d
feat(date-range-picker): Add new resources from Angular.
skrustev dbf491d
fix(core): Fix default return if there's no resources.
skrustev c924296
feat(resources): Add index files for each language.
skrustev 0cdd2de
feat(*): Add subfolders to both core and resoures packages.
skrustev b2f80ce
fix(resources): Add missing Banner resources in SV. Reorder resource …
skrustev 14f9922
chore(*): Update workflow with correct folders and paths.
skrustev 852b1b7
chore(*): Try setting dependency version for resources.
skrustev 02ba45d
chore(*): Try pwsh variable syntax.
skrustev 814c6d2
chore(*): Try another way of getting env virable in pwsh. Disable pub…
skrustev f245253
chore(*): Set proper version now. Enable publish back.
skrustev 37fc224
chore(*): Set peer dep version in core package as well. Remove mappin…
skrustev 1425752
Merge master into skrastev/localization
skrustev 3bb6d8d
Separate core logic into smaller chunks. Add linter and more general …
skrustev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Description | ||
Describe the issue. | ||
|
||
* browser: | ||
|
||
### Steps to reproduce | ||
|
||
1. Step 1 | ||
2. Step 2 | ||
3. ... | ||
|
||
### Result | ||
What is the actual result after following the steps to reproduce? | ||
|
||
### Expected result | ||
What is the expected result after following the steps to reproduce? | ||
|
||
|
||
### Attachments | ||
Attach a sample if available, and screenshots, if applicable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Closes # | ||
|
||
### Additional information (check all that apply): | ||
- [ ] Bug fix | ||
- [ ] New functionality | ||
- [ ] Documentation | ||
- [ ] CI/CD | ||
|
||
### Checklist: | ||
- [ ] All relevant tags have been applied to this PR | ||
- [ ] This PR includes unit tests covering all the new code ([test guidelines](https://github.com/IgniteUI/igniteui-angular/wiki/Test-implementation-guidelines-for-Ignite-UI-for-Angular)) | ||
- [ ] This PR includes API docs for newly added methods/properties ([api docs guidelines](https://github.com/IgniteUI/igniteui-angular/wiki/Documentation-Guidelines)) | ||
- [ ] This PR includes general feature table updates in the root `README.MD` | ||
- [ ] This PR includes `CHANGELOG.MD` updates for newly added functionality | ||
- [ ] This PR contains breaking changes | ||
- [ ] This PR includes behavioral changes and the feature specification has been updated with them | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ master ] | ||
schedule: | ||
- cron: '24 4 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ master, '[0-9]+.[0-9]+.x' ] | ||
pull_request: | ||
branches: [ master, '[0-9]+.[0-9]+.x' ] | ||
|
||
jobs: | ||
run-tests: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x, 22.x] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install packages | ||
run: npm ci | ||
- name: Install Playwright | ||
run: npx playwright install --with-deps --only-shell chromium | ||
- name: Lint | ||
run: npm run lint | ||
- name: Build Core & Resources | ||
run: npm run build | ||
- name: Test | ||
run: npm run test | ||
- name: Publish to coveralls.io | ||
if: github.repository == 'IgniteUI/igniteui-i18n' && matrix.node-version == '20.x' | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ github.token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Npm.js deploy | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
- run: echo ${VERSION} | ||
|
||
- run: npm ci | ||
|
||
- name: Build the package | ||
run: npm run build | ||
|
||
- name: Define npm tag | ||
run: | | ||
if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then echo "NPM_TAG=next"; else echo "NPM_TAG=latest"; fi >> $GITHUB_ENV | ||
echo ${NPM_TAG} | ||
|
||
- name: Version the package | ||
run: npm version ${VERSION} --no-git-tag-version --save --verbose | ||
working-directory: dist | ||
|
||
- name: Publish the package | ||
run: npm publish --tag ${NPM_TAG} | ||
working-directory: dist | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This is a commercial product, requiring a valid paid-for license for commercial use. | ||
This product is free to use for non-commercial educational use for students in K through 12 grades | ||
or University programs, and for educators to use in a classroom setting as examples / tools in their curriculum. | ||
|
||
In order for us to verify your eligibility for free usage, please register for trial at | ||
https://Infragistics.com/Angular and open a support ticket with a request for free license. | ||
|
||
To acquire a license for commercial usage, please register for trial at https://Infragistics.com/Angular | ||
and refer to the purchasing options in the pricing section on the product page. | ||
|
||
This repository includes code originally copied from https://github.com/zloirock/core-js | ||
in the projects/igniteui-angular/src/lib/core/setImmediate.ts file. The original version of the code is MIT licensed. See the file header for details. | ||
|
||
© Copyright 2020 INFRAGISTICS. All Rights Reserved. | ||
The Infragistics Ultimate license & copyright applies to this distribution. | ||
For information on that license, please go to our website https://www.infragistics.com/legal/license. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,104 @@ | ||
# igniteui-i18n-core | ||
Ignite UI Internationalization packages, containing localization functionality, translation resources and locale formatting. | ||
<h1 align="center"> | ||
Ignite UI Localization - from Infragistics | ||
</h1> | ||
|
||
 | ||
[](https://coveralls.io/github/IgniteUI/igniteui-i18n?branch=master) | ||
[](https://badge.fury.io/js/igniteui-i18n) | ||
|
||
The Ignite UI i18n repository provides localized strings and locale formatting to all Ignite UI products and components. The core package provides the functionality for locale and resource strings management, while the resources package provides localized resource strings for each currently supported language by Ignite UI. Both combined gives a unified and easy way of setting desired language or locale for the Ignite UI components globally and individually for each component. | ||
|
||
## Setup | ||
|
||
To setup the repo for local work run: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
## Building | ||
|
||
To build all packages run: | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
To build just the core package run: | ||
|
||
``` | ||
npm run build:core | ||
``` | ||
|
||
|
||
To build just the resources package run: | ||
|
||
``` | ||
npm run build:resources | ||
``` | ||
|
||
## Lint | ||
|
||
The repo follows coding guidelines, which are kept in check using lint. To run it locally run: | ||
|
||
``` | ||
npm run lint | ||
``` | ||
|
||
|
||
## Tests | ||
|
||
The repo uses [Vitest](https://vitest.dev/guide/) for a base testing framework and [Playwright](https://vitest.dev/guide/browser/playwright.html) for in browser testing. Also the ability for out of browser testing is available using [jsdom](https://github.com/jsdom/jsdom). It is highly encouraged to use the native browser one, while the other can be used for easier debugging of tests and core functionality, but keep in might the nature of `jsdom` not being a native browser. | ||
|
||
If you are using `VSCode`, I recommend to install the [Vitest extension](https://marketplace.visualstudio.com/items?itemName=vitest.explorer) as well, otherwise debugging using `Javscript Debug Console` does not work for me as expected and the source maps are not correct. Maybe its a config issue, but using the plugin is easier anyway for debugging. | ||
|
||
To run the tests run: | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
If you use Playwright for the first time it will throw an error. Just install the necessary dependencies using: | ||
|
||
``` | ||
npx playwright install --with-deps --only-shell chromium | ||
``` | ||
|
||
By default the tests run in `headless` mode using `Chromium`. If you would like to see it in the browser itself you need to set [headless](https://vitest.dev/guide/browser/config.html#browser-headless) option in the `vitest.browser.config.ts` file for the desired browser: | ||
|
||
``` | ||
test: { | ||
browser: { | ||
headless: false | ||
} | ||
} | ||
``` | ||
|
||
To run a specific test, set in the test source `only` option for a test in the following way: | ||
|
||
```typescript | ||
it('should test something', { only: true }, () => { | ||
// Test code | ||
}) | ||
|
||
``` | ||
|
||
The following way should also work (but not for me :s ): | ||
|
||
```typescript | ||
it.only('should test something', () => { | ||
// Test code | ||
}) | ||
|
||
``` | ||
|
||
## License | ||
This is a commercial product, requiring a valid paid-for license for commercial use. | ||
This product is free to use for non-commercial educational use for students in K through 12 grades or University programs, and for educators to use in a classroom setting as examples / tools in their curriculum. | ||
In order for us to verify your eligibility for free usage, please [register for trial](https://Infragistics.com/Angular) and open a support ticket with a request for free license. | ||
|
||
To acquire a license for commercial usage, please [register for trial](https://Infragistics.com/Angular) and refer to the purchasing options in the pricing section on the product page. | ||
|
||
© Copyright 2020 INFRAGISTICS. All Rights Reserved. | ||
The Infragistics Ultimate license & copyright applies to this distribution. | ||
For information on that license, please go to our website [https://www.infragistics.com/legal/license](https://www.infragistics.com/legal/license). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.