question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add `typesafe-18n` support

See original GitHub issue

What framework do you want to have? Please provide links of its i18n solution/package. https://github.com/ivanhofer/typesafe-i18n

Please provide some overall screenshots about how the i18n usage would be like

  • svelte image
  • react image
  • angular image image

Please provide a minimal starter project https://github.com/ivanhofer/typesafe-i18n

There are angular, svelte and react examples inside the examples folder

Additional context

I tried to get it working using this wiki-page, The keys show up, but the locale files are not detected. I could not figure out how. Please help!

# .vscode/i18n-ally-custom-framework.yml

languageIds:
   - javascript
   - typescript
   - javascriptreact
   - typescriptreact
   - html
   - svelte

usageMatchRegex:
   - "LL\\.([^(]+)\\("

# refactorTemplates:
#  - LL.$1()

monopoly: true

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ivanhofercommented, Oct 20, 2021

@Juici I have tweaked the config a bit and this is now the config I use:

.vscode/settings.json

{
   "i18n-ally.pathMatcher": "{locale}/index.{ext}",
   "i18n-ally.enabledParsers": ["ts", "js"],
   "i18n-ally.keystyle": "nested",
   "i18n-ally.localesPaths": ["src/i18n"]
}

.vscode/i18n-ally-custom-framework.yml

languageIds:
   - typescript
   - javascript
   - typescriptreact
   - javascriptreact
   - svelte
   - html

usageMatchRegex:
   - "\\$?LL\\.({key})\\(((\\{.*\\})|([^)]*))\\)"

refactorTemplates:
   - '{$LL.$1()}'
   - '{LL.$1()}'
   - '$LL.$1()'
   - 'LL.$1()'

monopoly: true

It works really great! I will try to convert that config to a Framework class

1reaction
ivanhofercommented, Oct 18, 2021

@Juici wow, looks really cool 👍 I will try it on some of my projects the next days

Read more comments on GitHub >

github_iconTop Results From Across the Web

typesafe-i18n - npm
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.. Latest version: 5.18.0, last published: 15 ...
Read more >
typesafe-i18n | Yarn - Package Manager
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects. i18n, typescript, internationalization ...
Read more >
typesafe-i18n - fully typesafe and lightweight i18n library
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.
Read more >
A type-safe i18n React library : r/javascript - Reddit
Add a Comment ... i18nifty is a React library, typesafe-i18n support most framework. ... In typesafe-i18n translation are flat strings.
Read more >
How to define aliases of locales in typesafe-i18n?
The generated detectLocale function defined as following in src/i18n/i18n-util.ts will use locales (a generated variable showing a list of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found