Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support localization (#309) #861

Open
wants to merge 42 commits into
base: dev
Choose a base branch
from
Open

Conversation

Sieluna
Copy link

@Sieluna Sieluna commented Dec 15, 2024

PR Summary:

  1. Translation files need to be in UTF-16 LE with BOM format.
  2. ESL file is required, if you don't want to wait for all forms to load: CommunityShaders - esl.zip

@Pentalimbed
Copy link
Collaborator

Have you tested it? Because I don't think our font has CJK glyphs.

@Sieluna
Copy link
Author

Sieluna commented Dec 15, 2024

Have you tested it? Because I don't think our font has CJK glyphs.

I'm temporarily using the default fonts that come with Windows.

I plan to write an additional Python script to bake the fonts later.

you can check the preview video here: #862

@Pentalimbed
Copy link
Collaborator

I plan to write an additional Python script to bake the fonts later.

Why additional python scripts tho? I think you can just use FontBuilder in ImGui and set the glyph ranges.

@Sieluna
Copy link
Author

Sieluna commented Dec 15, 2024

Why additional python scripts tho? I think you can just use in ImGui and set the glyph ranges.FontBuilder

The main reason is that I don’t want to upload multiple font blob files, for example Source Han Sans, which, if bundled with Japanese, Korean, and Chinese characters, would total about 20MB. I aim to pre-bake the assets to include only the characters that are actually used.

@doodlum
Copy link
Owner

doodlum commented Dec 16, 2024

Why additional python scripts tho? I think you can just use in ImGui and set the glyph ranges.FontBuilder

The main reason is that I don’t want to upload multiple font blob files, for example Source Han Sans, which, if bundled with Japanese, Korean, and Chinese characters, would total about 20MB. I aim to pre-bake the assets to include only the characters that are actually used.

This sounds like it needs to be part of the build system? Though I guess we'd only rerun when someone sees missing characters

@Sieluna
Copy link
Author

Sieluna commented Dec 18, 2024

The code is expected to function without any significant issues. If you prefer to load the translation file immediately rather than relying on lazy loading, you can use a empty esp to assist SKSE load all assets at game startup.

CommunityShaders - esl.zip

@Sieluna Sieluna requested a review from Pentalimbed December 18, 2024 20:18
Copy link
Collaborator

@Pentalimbed Pentalimbed left a comment

Choose a reason for hiding this comment

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

  1. (CN)
  • "shaders"->着色器
  • "File Watcher"->文件监控
  • "deadzone"->死区
  1. Is the Japanese translation verified by any actual Japanese speaker?

@Sieluna
Copy link
Author

Sieluna commented Dec 18, 2024

Fixed txt was treated as binary. This means that the project must use the git version after this commit
git/git@aab2a1a

@alandtse
Copy link
Collaborator

Lokalise is free for open source projects. As are other platforms. It's just a matter of doodlum choosing and setting it up.

@Sieluna
Copy link
Author

Sieluna commented Dec 25, 2024

Preview.mp4

@Sieluna
Copy link
Author

Sieluna commented Dec 25, 2024

@alandtse A sad news is that Lokalise requires you to submit translations via a PR (maybe everyday) Sieluna#1 . Currently, the only way to bypass the action steps is to avoid giving Lokalise PR permissions. actions

Screenshot 2024-12-26 000649

Screenshot 2024-12-26 004422

@alandtse
Copy link
Collaborator

I use it in another open source project. You just set a ci to pull the latest translations. No need for PRs.

@Sieluna
Copy link
Author

Sieluna commented Dec 25, 2024

I use it in another open source project. You just set a ci to pull the latest translations. No need for PRs.

How can you achieve this? The action forces me to create a PR: https://github.com/lokalise/lokalise-pull-action/blob/b7587f118420378e8fd825a04ac27a70bf2778f0/action.yml#L123-L134

@alandtse
Copy link
Collaborator

A cronjob PR is fine. Or https://github.com/alandtse/alexa_media_player/blob/dev/.github%2Fworkflows%2Fsemantic_release.yml#L19-L36.

@Sieluna
Copy link
Author

Sieluna commented Dec 26, 2024

@doodlum @alandtse @Pentalimbed I think the workflow is now stable and ready for review.
Build status: Status

Artifact: Release (Support Spanish & Chinese only)

@alandtse
Copy link
Collaborator

Can you provide a link to the lokalise project so we can join. We'll need at least one of us to be an admin of the project before we pull the PR.

@Sieluna
Copy link
Author

Sieluna commented Dec 26, 2024

Can you provide a link to the lokalise project so we can join. We'll need at least one of us to be an admin of the project before we pull the PR.

This requires your team to handle the configuration. My Lokalise account is currently in a free trial state and will expire soon. It's just for demonstration purposes.

The configuration is very simple:

  1. You only need to register a Lokalise account.
  2. Go to this address: https://github.com/doodlum/skyrim-community-shaders/settings/secrets/actions
    Set up the Token and ID (repo or env both are fine).
    image
    image
  3. Go to the workflow and run Push to Lokalise (This is require when you add more translation key): https://github.com/doodlum/skyrim-community-shaders/actions/workflows/lokalise.yaml
    image
  4. Then go to Lokalise for translation, come back, and build it.
    image

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.

4 participants