Skip to content

Commit 4dc1fce

Browse files
committedFeb 18, 2025·
#1097 Remove i18nMap and switch to regex based invalid key check
1 parent a9fc84c commit 4dc1fce

File tree

156 files changed

+3567
-4869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+3567
-4869
lines changed
 

‎.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules/
22
.nuxt/
33
.output/
44

5+
dist/
56
playwright-report/
67
tests-examples/
78
test-results/

‎STYLEGUIDE.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,21 @@ activist is a global platform and must function in countless different regions a
234234
235235
Localization keys should be defined based on the file in which they're used within the platform and the content that they refer to (`CONTENT_REFERENCE` below). Please use the following rules as a guide if you find yourself needing to create new localization keys:
236236

237-
- Please use the [i18n-check](https://github.com/activist-org/i18n-check) `i18nMap` object for all texts within the frontend
238-
- This object returns the sequence of object methods as a string and allows the type checker to be used to check key accuracy
239-
- Ex: Using the `i18nMap` object:
240-
-`i18nMap._global.foo`
237+
- In following [i18n-check](https://github.com/activist-org/i18n-check) standards, please prepend all i18n keys with `i18n`
238+
- This allows us to check all keys that are in use against those found in the `en-US.json` file
239+
-`i18n._global.foo`
241240
-`"_global.foo"`
242241
- Separate directories and references by `.` and PascalCase/camelCase file name components by `_` in keys
243-
- Ex: `i18nMap.components.landing_splash.CONTENT_REFERENCE` for the `LandingSplash` component
242+
- Ex: `i18n.components.landing_splash.CONTENT_REFERENCE` for the `LandingSplash` component
244243
- Even though Nuxt allows for us to nest components in directories, avoid repetition in the directory path used to define the localization key
245244
- Ex: If you're defining a key within `CardAbout`:
246-
-`i18nMap.components.footer_flex.CONTENT_REFERENCE`
247-
-`i18nMap.components.footer.footer_flex.CONTENT_REFERENCE`
245+
-`i18n.components.footer_flex.CONTENT_REFERENCE`
246+
-`i18n.components.footer.footer_flex.CONTENT_REFERENCE`
248247
- Define keys based on the lowest level file in which they're used
249248
- Use `_global` to indicate that a key is used in multiple places in a given directory
250249
- Ex: You're creating a key that's used by multiple landing page components:
251-
-`i18nMap.components.landing._global.CONTENT_REFERENCE`
252-
-`i18nMap.components.landing.INDIVIDUAL_COMPONENT.CONTENT_REFERENCE`
250+
-`i18n.components.landing._global.CONTENT_REFERENCE`
251+
-`i18n.components.landing.INDIVIDUAL_COMPONENT.CONTENT_REFERENCE`
253252
- Please end all aria-label keys with `_alt_text` so the localization team knows that they're for screen readers
254253
- If you need a capitalized and lower case version of a word, signify the lower case version with `_lower` at the end of the key
255254
- For pages with long texts please follow the below naming criteria:

0 commit comments

Comments
 (0)
Please sign in to comment.