Skip to content

Conversation

@leavesster
Copy link
Contributor

@leavesster leavesster commented Apr 21, 2025

This pull request will added locale support.

Developer can use Localized Object to support i10n in error message and report message.

export type LocalizeInfo = {
  localize: {
    $key: string;
    [key: string | number]: string | number | LocalizeInfo["localize"];
  }
};

we will search $key's value in a json (different language will use different name like en.json it depends on end-user's location)

{
  "aaa": "this is a example for i10n with replace for {replace}"
}

object like below will translate

localizeInfo = {
  "localize": {
    "$key": "aaa"
    "replace": "oocana-python"
  }
}

to this is a example for i18n with replace for oocana-python. params value accept localizedObject or plain string.

@leavesster leavesster requested review from crimx and hyrious April 21, 2025 06:52
@leavesster leavesster marked this pull request as draft April 21, 2025 06:53
@leavesster leavesster force-pushed the main branch 2 times, most recently from c85c502 to 6d00ffe Compare August 2, 2025 16:00
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.

3 participants