🔄 chore: Enforce 18next Language Keys (#5803)

* chore: enforcing language keys to adhere to the new standard.

* chore: enforcing i18n forbids to write plain text in JSX markup

* chore: enforcing i18n forbids to write plain text in JSX markup

* fix: ci with checkbox for unused keys :)

* refactor: removed all the unused `i18n` keys
This commit is contained in:
Ruben Talstra 2025-02-12 21:48:13 +01:00 committed by GitHub
parent 2a506df443
commit 7f48030452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 200 additions and 219 deletions

View file

@ -34,7 +34,7 @@ export default function ActionsAuth({ disableOAuth }: { disableOAuth?: boolean }
</div>
<div className="border-token-border-medium flex rounded-lg border text-sm hover:cursor-pointer">
<div className="h-9 grow px-3 py-2">
{localize(`com_ui_${type}` as TranslationKeys)}
{localize(getAuthLocalizationKey(type))}
</div>
<div className="bg-token-border-medium w-px"></div>
<button type="button" color="neutral" className="flex items-center gap-2 px-3">
@ -269,6 +269,18 @@ const ApiKey = () => {
);
};
/** Returns the appropriate localization key for authentication type */
function getAuthLocalizationKey(type: AuthTypeEnum): TranslationKeys {
switch (type) {
case AuthTypeEnum.ServiceHttp:
return 'com_ui_api_key';
case AuthTypeEnum.OAuth:
return 'com_ui_oauth';
default:
return 'com_ui_none';
}
}
const OAuth = () => {
const localize = useLocalize();
const { register, watch, setValue } = useFormContext();