Skip to content

Conversation

@Mateusz-Dobrzynski
Copy link
Member

Resolves #5:

  • Introduces an i18n framework (i18n-intl),
  • Updates dependencies,
  • Internationalizes existing views,
  • Extracts repetitions into separate components.

@Mateusz-Dobrzynski Mateusz-Dobrzynski self-assigned this Sep 2, 2025
@Mateusz-Dobrzynski Mateusz-Dobrzynski added the enhancement New feature or request label Sep 2, 2025
@Mateusz-Dobrzynski Mateusz-Dobrzynski linked an issue Sep 2, 2025 that may be closed by this pull request
case "en":
return "English";
case "pl":
return "Polski";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return "Polski";
return "polski";

:P

Copy link
Member Author

Choose a reason for hiding this comment

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

I remember us having this conversation a while back and your argument (correct me, if I'm wrong) that while lowercase "polski" is ugly, it's the standard. Since then, I've found more than enough counterpoints (e.g. Chrome and Firefox language settings) to support the decision of keeping it consistent. Notable apps use the version we like better anyway, so why force ourselves for the worse?

Copy link
Member

@jakubmanczak jakubmanczak Sep 3, 2025

Choose a reason for hiding this comment

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

My argument was that it's correct, in regards to language rules. And also used, more or less standard.

Copy link
Member Author

@Mateusz-Dobrzynski Mateusz-Dobrzynski Sep 4, 2025

Choose a reason for hiding this comment

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

If you were to use that word in a sentence, surely (My first language is English, but Moim językiem ojczystym jest polski). However, that's not the case here. In many contexts it's common to start words with capital letters, even though there are no grammatical rules enforcing that (unlike in e.g. German). We don't have to cling on to the rules, especially when we're not breaking any.

@julesity, what's your opinion on this? Context: should "Polski" should be lowercase here or can it be the way it is – and why?

image

Mateusz-Dobrzynski and others added 2 commits September 3, 2025 10:07
import GenericSelect from "../ui/GenericSelect";
import { LanguageCode } from "@/types/Language";
import { FlagIcon } from "../icons/FlagIcon";
import { getEndonym, LANGUAGE_COOKIE, languages } from "@/i18n/language-utils";
Copy link
Member

Choose a reason for hiding this comment

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

As far as I'm aware, while aren't required to get consent for 'strictly necessary' cookies like language or color schemes under GDPR, we do need to disclose the details of their use somewhere. A thing to keep in mind - maybe a subpage about it somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

By default, next-intl uses session cookies to be "compliant out of the box". I'm leaving it that way until we come up with a sensible idea to present cookie disclaimers.

- make URL accurately reflect website language
- in case of locale-less URLs, redirect to localized pages instead of returning 404
Copy link
Member

@jakubmanczak jakubmanczak left a comment

Choose a reason for hiding this comment

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

I can't seem to be able to log in as initial infrastructure admin. Can you? If yes, we should schedule a chat to sort out the differences in our approaches, because one of us is doing something wrong.

Also featuring: miscellaneous string changes.

@jakubmanczak
Copy link
Member

Compilation is broken due to eslint errors on unused variables. Might be nice to add an ignore clause to the eslint config. Offhand comment: what version npm are you using, that you're not getting this?

rules: {
      "@next/next/no-img-element": "off",
      "@typescript-eslint/no-unused-vars": "off",
    },

Otherwise, it complains about malformed JSON responses. Again, we must be doing something very differently; it's really worrying that I'm unable to even handtest the frontend while you're presumably unaffected.

@Mateusz-Dobrzynski
Copy link
Member Author

Changes to eslint config were made.

What version npm are you using, that you're not getting this?

Well, I was. However, unused variables were already present in the code, so I assumed it's fine by our standards and ignored it (maybe if I remembered to build the app, would've done it differently).

Otherwise, it complains about malformed JSON responses.

Unclear, not sure what to do about it. I double-checked functionality of the app using 0713216 as backend. The fix introduced in debatecore/tau#74 is necessary, it won't work with what's present master branch (otherwise I wouldn't have made the fix to begin with).

@jakubmanczak
Copy link
Member

As it turns out, the malformed JSON response was due to another bug that only occurs when no tournaments are present in the database - an empty response is sent instead of an empty json array. (Clearing your tau_dbdevdata docker volume when doublechecking such things is expected as it lands you a clean starting point!). This being said, this is an issue with another part of the codebase, making no difference here.

Co-authored-by: Jakub Mańczak <jakub@manczak.net>
@jakubmanczak
Copy link
Member

image

@Mateusz-Dobrzynski Mateusz-Dobrzynski merged commit 2f1c399 into master Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement i18n

3 participants