Skip to content
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

Merge branch 'master' into service-catalog-eap #561

Merged
merged 42 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2729a35
feat: validate CC tag when leaving the field
BrunoBFerreira Oct 2, 2024
872d828
Merge pull request #527 from zendesk/brunobferreira/GG-3804/update-cc…
BrunoBFerreira Oct 3, 2024
1626228
chore(release): 4.2.0
zd-svc-github-copenhagen-theme Oct 3, 2024
6d77506
fix: change section page header flex wrap
gosiexon-zen Oct 3, 2024
b5c170e
Merge pull request #529 from zendesk/mbien/fix-section-header-layout
luis-almeida Oct 3, 2024
cddb583
chore(release): 4.2.1
zd-svc-github-copenhagen-theme Oct 3, 2024
0c01d76
fix: paragraph gets treated as comma
melzreal Oct 4, 2024
670338e
Merge pull request #530 from zendesk/melreal/fix-comma-treated-as-par…
melzreal Oct 7, 2024
e7fcde1
chore(release): 4.2.2
zd-svc-github-copenhagen-theme Oct 7, 2024
4f01052
fix: added validation of date format for ticket field prefilling
Fredx87 Oct 25, 2024
67fd377
fix: fixed date fields prefilling with wrong dates in some timezones
Fredx87 Oct 25, 2024
34ce8e9
refactor: added useCallback for datepicker callbacks
Fredx87 Oct 29, 2024
4b06426
Merge pull request #536 from zendesk/gianluca/fix-date-prefill
Fredx87 Oct 30, 2024
a9a12f0
chore(release): 4.2.3
zd-svc-github-copenhagen-theme Oct 30, 2024
6127e57
fix: add aria label for removing attachment
gosiexon-zen Nov 14, 2024
dd60aeb
Merge pull request #543 from zendesk/mbien/attachments-a11y-issue
gosiexon-zen Nov 25, 2024
6f47597
chore(release): 4.2.4
zd-svc-github-copenhagen-theme Nov 25, 2024
1c568c7
fix: line-break strict for correct text wrapping
melzreal Dec 2, 2024
ee039ac
Merge pull request #548 from zendesk/melreal/adjust-table
melzreal Dec 4, 2024
2ac15d7
chore(release): 4.2.5
zd-svc-github-copenhagen-theme Dec 4, 2024
7ab8164
chore: added translation strings for the Service Catalog
gosiexon-zen Dec 4, 2024
b1e1480
Merge pull request #550 from zendesk/mbien/service-catalog-translations
gosiexon-zen Dec 5, 2024
ff3a612
chore: translations for ticket fields module
gosiexon-zen Dec 5, 2024
31a4463
Merge pull request #551 from zendesk/mbien/ticket-fields-translations
gosiexon-zen Dec 9, 2024
6fa919d
chore: add new string for translations
gosiexon-zen Dec 11, 2024
6840432
Merge pull request #553 from zendesk/mbien/new-translation-strings
gosiexon-zen Dec 16, 2024
cacde81
fix: update zendeskgarden packages to v8.76.9
gosiexon-zen Dec 18, 2024
f4611b6
chore(i18n): automated modules resolution in bin/update-modules-trans…
Fredx87 Dec 20, 2024
492f30a
chore(i18n): improved bin/extract-strings.mjs
Fredx87 Dec 20, 2024
73ff7ce
chore(i18n): improved extraction of plural strings
Fredx87 Jan 3, 2025
e701dc3
docs(i18n): updated i18n docs in README
Fredx87 Jan 3, 2025
aa1b516
Merge pull request #559 from zendesk/gianluca/i18n-scripts-improvements
Fredx87 Jan 6, 2025
c1b2c0f
Merge branch 'master' into mbien/upgrade-garden-forms-package
gosiexon-zen Jan 7, 2025
7f3aa31
Merge pull request #556 from zendesk/mbien/upgrade-garden-forms-package
gosiexon-zen Jan 7, 2025
d65277b
chore(release): 4.2.6
zd-svc-github-copenhagen-theme Jan 7, 2025
f811fd5
fix: upload translations
gosiexon-zen Dec 19, 2024
f33cd7b
Merge pull request #557 from zendesk/mbien/upload-translations
gosiexon-zen Jan 7, 2025
f998ad7
chore(release): 4.2.7
zd-svc-github-copenhagen-theme Jan 7, 2025
20c2e7a
Merge branch 'master' into service-catalog-eap
Fredx87 Jan 9, 2025
7cc8b69
chore: fixed lightouse check on CI
Fredx87 Jan 9, 2025
a71a3ac
Merge pull request #563 from zendesk/gianluca/fix-lighthouse
Fredx87 Jan 9, 2025
2f5568c
Merge branch 'master' into service-catalog-eap
Fredx87 Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
uses: zendesk/setup-node@v3
with:
node-version-file: '.nvmrc'
# The following step is needed to run puppeteer with ubuntu >= 23.10
# ref: https://pptr.dev/troubleshooting#issues-with-apparmor-on-ubuntu
- name: Disable AppArmor
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Build
Expand Down
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
## [4.2.7](https://github.com/zendesk/copenhagen_theme/compare/v4.2.6...v4.2.7) (2025-01-07)


### Bug Fixes

* upload translations ([f811fd5](https://github.com/zendesk/copenhagen_theme/commit/f811fd5ccd41168903e9fcdd6314d24b96b844b0))

## [4.2.6](https://github.com/zendesk/copenhagen_theme/compare/v4.2.5...v4.2.6) (2025-01-07)


### Bug Fixes

* update zendeskgarden packages to v8.76.9 ([cacde81](https://github.com/zendesk/copenhagen_theme/commit/cacde8136f3a43b1d8f6f348cd88000b4eef436f))

## [4.2.5](https://github.com/zendesk/copenhagen_theme/compare/v4.2.4...v4.2.5) (2024-12-04)


### Bug Fixes

* line-break strict for correct text wrapping ([1c568c7](https://github.com/zendesk/copenhagen_theme/commit/1c568c7b53aca9471e1b50850e6869145a9400c9))

## [4.2.4](https://github.com/zendesk/copenhagen_theme/compare/v4.2.3...v4.2.4) (2024-11-25)


### Bug Fixes

* add aria label for removing attachment ([6127e57](https://github.com/zendesk/copenhagen_theme/commit/6127e579dc3dec233b39eefbceb76137da3b95aa))

## [4.2.3](https://github.com/zendesk/copenhagen_theme/compare/v4.2.2...v4.2.3) (2024-10-30)


### Bug Fixes

* added validation of date format for ticket field prefilling ([4f01052](https://github.com/zendesk/copenhagen_theme/commit/4f01052cc6b3d12131a6dcaeab2d9b2a9ef76951))
* fixed date fields prefilling with wrong dates in some timezones ([67fd377](https://github.com/zendesk/copenhagen_theme/commit/67fd3772684fcdb1055ecf2fd91c9cd64c38cf25))

## [4.2.2](https://github.com/zendesk/copenhagen_theme/compare/v4.2.1...v4.2.2) (2024-10-07)


### Bug Fixes

* paragraph gets treated as comma ([0c01d76](https://github.com/zendesk/copenhagen_theme/commit/0c01d76f7646a3c706a6c755aa6e671aa27a2a53))

## [4.2.1](https://github.com/zendesk/copenhagen_theme/compare/v4.2.0...v4.2.1) (2024-10-03)


### Bug Fixes

* change section page header flex wrap ([6d77506](https://github.com/zendesk/copenhagen_theme/commit/6d77506b3af53eee80f8d918d1f362f90ca20848))

# [4.2.0](https://github.com/zendesk/copenhagen_theme/compare/v4.1.0...v4.2.0) (2024-10-03)


### Features

* validate CC tag when leaving the field ([2729a35](https://github.com/zendesk/copenhagen_theme/commit/2729a3553cc1b3a24a1f39c16b1f782c271b5cde))

# [4.1.0](https://github.com/zendesk/copenhagen_theme/compare/v4.0.11...v4.1.0) (2024-09-23)


Expand Down
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ function MyComponent() {
Providing the default English value in the code makes it possible to use it as a fallback value when strings are not yet translated and to extract the strings from the source code to the translations YAML file.

#### Plurals
When using [plurals](https://www.i18next.com/translation-function/plurals), we need to provide default values for the `zero`, `one`, and `other` values, as requested by our translation system. This can be done by passing the default values in the [options](https://www.i18next.com/translation-function/essentials#overview-options) of the `t` function.
When using [plurals](https://www.i18next.com/translation-function/plurals), you need to provide default values for at least the `one` and `other` forms. You can also pass a default value for the `zero` form, if you want it to be different from the `other` form. This can be done by passing the default values in the [options](https://www.i18next.com/translation-function/essentials#overview-options) of the `t` function.

```ts
t("my-key", {
"defaultValue.zero": "{{count}} items",
"defaultValue.zero": "No items",
"defaultValue.one": "{{count}} item",
"defaultValue.other": "{{count}} items",
count: ...
Expand All @@ -191,23 +191,42 @@ t("my-key", {

#### String extraction

The `bin/extract-strings.mjs` script can be used to extract translation strings from the source code and put them in the YAML file that is picked up by our internal translation system. The usage of the script is documented in the script itself.
The `bin/extract-strings.mjs` script can be used to extract translation strings from the source code and put them in the YAML file that is picked up by our internal translation system.

The script wraps the `i18next-parser` tool and converts its output to the YAML format used internally. It is possible to use a similar approach in a custom theme, either using the standard `i18next-parser` output as the source for translations or implementing a custom transformer.
To extract the strings for all the modules, run:

#### Updating translation files
```bash
yarn i18n:extract
```

To extract the strings for a specific module, run:

Use the `bin/update-modules-translations.mjs` to download the latest translations for all the modules. All files are then bundled by the build process in a single `[MODULE]-translations-bundle.js` file.
```bash
yarn i18n:extract --module=module-name
```

The first time that translations are added to a module, you need to add a mapping between the module folder and the package name on the translations systems to the `MODULE` variable in the script. For example, if a module is located in `src/modules/my-module` and the package name is `cph-theme-my-module`, you need to add:
You can also pass the `--mark-obsolete` flag to mark removed strings as obsolete:

```js
const MODULES = {
...,
"my-module": "cph-theme-my-module"
}
```bash
yarn i18n:extract --mark-obsolete
```

If you are adding a new module, you need first to create the initial `src/modules/[MODULE]/translations/en-us.yml` file with the header containing the title and package name:

```yaml
title: "My Module"
packages:
- "package-name"
```

The script wraps the `i18next-parser` tool and converts its output to the YAML format used internally. It is possible to use a similar approach in a custom theme, either using the standard `i18next-parser` output as the source for translations or implementing a custom transformer.

#### Updating translation files

You can run `yarn i18n:update-translations` to download the latest translations files for all the modules. The script downloads all the locale files for each module, fetching the package name from the `src/modules/[MODULE]/translations/en-us.yml` file, and saves them in the `src/modules/[MODULE]/translations/locales` folder.

All files are then bundled by the build process in a single `[MODULE]-translations-bundle.js` file.

# Accessibility testing

We use a custom node script that runs [lighthouse](https://github.com/GoogleChrome/lighthouse) for automated accessibility testing.
Expand Down
32 changes: 1 addition & 31 deletions assets/flash-notifications-bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading