Skip to content

Extend internationalization package with SSR and CSR and the ability to store selected language in cookies - #2

Merged
mmalfertheiner merged 14 commits into
aboutbits:masterfrom
stplasim:master
Oct 7, 2020
Merged

Extend internationalization package with SSR and CSR and the ability to store selected language in cookies#2
mmalfertheiner merged 14 commits into
aboutbits:masterfrom
stplasim:master

Conversation

@stplasim

@stplasim stplasim commented Oct 7, 2020

Copy link
Copy Markdown

Extend internationalization package with SSR and CSR and the ability to store selected language in cookies

Todos:

  • CSR: Get browser language

  • CSR: Store language in cookie

  • CSR: Get language form cookie

  • SSR: Get browser language

  • SSR: Store language in cookie

  • SSR: Get language form cookie

Comment thread src/index.ts Outdated
* @param language { string } - Language to set
* @param cookieName { string } - Optional: Cookie name
*/
static setLanguage(language: string, cookieName?: string): void {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this static function?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this method could be useful to quickly change the language without having to create a new instance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave it out for now and add it only if see a need for it.

@stplasim stplasim changed the title WIP: Extend internationalization package with SSR and CSR and the ability to store selected language in cookies Extend internationalization package with SSR and CSR and the ability to store selected language in cookies Oct 7, 2020
@mmalfertheiner
mmalfertheiner merged commit f97d7d3 into aboutbits:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants