profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/ivanhofer/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Hofer Ivan ivanhofer passion for modern technologies, TypeScript, Svelte, innovative UI/UX concepts and performance optimizations

ivanhofer/git-assistant 6

VS Code extension that detects common git (and submodule) issues and helps to solve them

ivanhofer/svelte 1

Cybernetically enhanced web apps

INSO-TUWien/git-assistant 0

VS Code extension that detects common git (and submodule) issues and helps to solve them

ivanhofer/awesome-i18n 0

🌍 A curated list of i18n resources for all kind of languages and frameworks

ivanhofer/kit 0

A monorepo for SvelteKit and friends

ivanhofer/size-limit 0

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.

push eventivanhofer/typesafe-i18n

Milo Moisson

commit sha 2b2bd15821610c075d85d1f06a4cc787e305a87e

fix #81 bug, cannot import folder with esmImport flag activated (#82) * fix(generator): esmImports flag does not work when trying to imports folder * update changelog Co-authored-by: Ivan Hofer <ivan.hofer@outlook.com>

view details

push time in a day

PR merged ivanhofer/typesafe-i18n

fix #81 bug, cannot import folder with esmImport flag activated

Fix #81

You cannot import folder with esmImport flag activated. I forgot to add support for folders.

+16 -6

1 comment

7 changed files

MrNossiom

pr closed time in a day

pull request commentivanhofer/typesafe-i18n

fix #81 bug, cannot import folder with esmImport flag activated

I missed that part too 🙈. Thanks for the fix!

MrNossiom

comment created time in a day

push eventMrNossiom/typesafe-i18n

Ivan Hofer

commit sha b66f8db82e0a31d99bf2282c1b9d9e257efa8ed3

update changelog

view details

push time in a day

pull request commentkheldar666/theorcs-express

`typesafe-i18n` improvements

I'm not exactly sure what this does: https://github.com/kheldar666/theorcs-express/blob/e42e12418cacdc6eacb2ad760ecab34e4d41b970/src/middlewares/i18nMiddleware.ts#L26-L36

But I can tell you is that the detectLocale function always returns something valid: https://github.com/kheldar666/theorcs-express/blob/e42e12418cacdc6eacb2ad760ecab34e4d41b970/src/middlewares/i18nMiddleware.ts#L45 If no match was found, it returns the base locale.

ivanhofer

comment created time in 2 days

PR opened kheldar666/theorcs-express

`typesafe-i18n` improvements

I just saw you are using typesafe-i18n in your repo. The type BaseTranslation should only be used for your base translation. All other translations should use the generated Translation type, to get better TypeScript support.

+2 -2

0 comment

1 changed file

pr created time in 2 days

push eventivanhofer/theorcs-express

Hofer Ivan

commit sha a5d8d6d91f582109ad082b84e5ce2b8c3e0fed65

`typesafe-i18n` improvements I just saw you are using `typesafe-i18n` in your repo. The type `BaseTranslation` should only be used for your base translation. All other translations should use the generated `Translation` type, to get better TypeScript support.

view details

push time in 2 days

fork ivanhofer/theorcs-express

TheORCS Project. This time using Node and Express.

fork in 2 days

pull request commentcheesefoo/subatomos-main

fix type for translation

You can also set this option to true, so it only loads the locale that is currently shown to the user: https://github.com/cheesefoo/subatomos-main/blob/001839ad7abbe710bac2fce417b09b1461507fbd/.typesafe-i18n.json#L3

ivanhofer

comment created time in 2 days

pull request commentcheesefoo/subatomos-main

fix type for translation

Here https://github.com/cheesefoo/subatomos-main/blob/001839ad7abbe710bac2fce417b09b1461507fbd/src/routes/__layout.svelte#L8 you could use the generated detectLocale function from src/i18n/i18n-util.ts so you only need to pass the detectors

ivanhofer

comment created time in 2 days

pull request commentcheesefoo/subatomos-main

fix type for translation

also: you need to run the generator to automatically update your types once you make changes to your base translation

ivanhofer

comment created time in 2 days

PR opened cheesefoo/subatomos-main

fix type for translation

I just saw you are using typesafe-i18n in your repo. The type BaseTranslation should only be used for your base translation. All other translations should use the generated Translation type, to get better TypeScript support.

+2 -2

0 comment

1 changed file

pr created time in 2 days

push eventivanhofer/subatomos-main

Hofer Ivan

commit sha ac2d8637a00b36c075d007016ff7bc636e61e2ae

fix type for translation I just saw you are using `typesafe-i18n` in your repo. The type `BaseTranslation` should only be used for your base translation. All other translations should use the generated `Translation` type, to get better TypeScript support.

view details

push time in 2 days

issue commentivanhofer/typesafe-i18n

Generator not compatible with "type": "module".

Fixed in version 2.39.0

MrNossiom

comment created time in 2 days

pull request commentivanhofer/typesafe-i18n

fix: add flag for esm support

Hi @ivanhofer,

I made all the changes you requested.

I also suggest you to simplify your prettier config to stay consistent with the eslint-config-prettier.

Best, Milo

@MrNossiom thanks for your PR. I just merged it :) You can now install the latest version 2.39.0

MrNossiom

comment created time in 2 days

push eventivanhofer/typesafe-i18n

Milo Moisson

commit sha 255394ea0342fbb5f880957c57898d15984438ac

feat: add flag for esm support (#81) * fix: add flag for esm support Fix: #80 * docs: add documentation for esm support flag * fix: remove space in import and modify README at types part * test: add tests for esmImports flag * refactor: change the flag esmSupport to esmImports * checkout PR * update changelog * refactor(generator): add a relativeFileImportPath function * test: add the tests for esmImports flag * improve esmImports docs Co-authored-by: Ivan Hofer <ivan.hofer@outlook.com>

view details

push time in 2 days

PR merged ivanhofer/typesafe-i18n

fix: add flag for esm support

Fix: #80

+1001 -543

8 comments

27 changed files

MrNossiom

pr closed time in 2 days

issue closedivanhofer/typesafe-i18n

Generator not compatible with "type": "module".

Hello Ivan,

I switched to full ESM modules and everything works except the generated file i18n-util.ts.

The import statement isn't compatible with ESM, since it imports without the .js extension and tries to import a folder directly.

Maybe there is a way to add support via a flag. (like esmSupport)

Something like this at https://github.com/ivanhofer/typesafe-i18n/blob/main/packages/generator/src/files/generate-util.ts#L114

- import { initFormatters } from './${formattersTemplatePath}'
+ import { initFormatters } from './${formattersTemplatePath}${esmSupport ? '.js' : ''}'

I can make a pull request if you accept with all necessary types and code changes.

I'm at your disposal for any questions

MrNossiom Thanks

closed time in 2 days

MrNossiom
PullRequestReviewEvent

push eventMrNossiom/typesafe-i18n

Ivan Hofer

commit sha 86dc1e02ba40474fb3f42ccc227ea3bbb6609336

improve esmImports docs

view details

push time in 2 days

push eventivanhofer/typesafe-i18n

Ivan Hofer

commit sha 46957b37c64e6e9e0c821f8861fa5b7e1f52b93f

feat: fix test and trigger version bump

view details

push time in 3 days

push eventivanhofer/typesafe-i18n

Ivan Hofer

commit sha b07122046e0dd321ca71bf539d9b939b679353d5

feat: fix test and trigger version bump

view details

push time in 3 days

push eventivanhofer/typesafe-i18n

Ivan Hofer

commit sha 8b25d7b5fd3f853d6b6e3db4bddad3a9842e592f

chore: add some tests

view details

Ivan Hofer

commit sha 7d12bbf02a6fb3eaf68365c9673e7fa36cfb9b88

feat: throw an Error when generator detects wrong input syntax

view details

push time in 3 days

startedikatyang/emoji-cheat-sheet

started time in 3 days

issue commentivanhofer/typesafe-i18n

Angular Adapter

@pit999 did you integrate typesafe-i18n into your Angular application? Did everything work?

pit999

comment created time in 4 days

issue commentsveltejs/svelte

id attribute on style rendered into shadow dom should be replaced with data-id

@BerndWessels just because everyone does it like this, does not mean that it is correct ;) You probably should create an issue in Chrome and other Browsers (or for the tool they use to check a11y). Maybe they don't know about the issue and are wiling to fix it..

BerndWessels

comment created time in 5 days

push eventMrNossiom/typesafe-i18n

Ivan Hofer

commit sha d4448be1982b4a70e8908a33d761756da571f2ba

update changelog

view details

push time in 5 days

PullRequestReviewEvent

Pull request review commentivanhofer/typesafe-i18n

fix: add flag for esm support

 const getLocalesTranslationRowSync = (locale: Locale, baseLocale: string): strin 	${wrappedLocale}${postfix},` } -const getSyncCode = ({ baseLocale, locales }: GeneratorConfigWithDefaultValues) => {+const getSyncCode = ({ baseLocale, locales, esmImports }: GeneratorConfigWithDefaultValues) => { 	const localesImports = locales 		.map( 			(locale) => `-import ${sanitizeLocale(locale)} from './${locale}'`,+import ${sanitizeLocale(locale)} from './${locale}${esmImports ? '.js' : ''}'`,

I think we could improve this by creating a helper function inside output-handler.ts

export const relativeFileImportParth = (file) => './${file}${esmImports ? '.js' : ''}'

and then call it like this

relativeFileImportParth(locale)
MrNossiom

comment created time in 5 days