Skip to content

Resx Localization - #23

Merged
love-linger merged 3 commits into
sourcegit-org:masterfrom
ennerperez:feature/resx
Mar 18, 2024
Merged

love-linger merged 3 commits into
sourcegit-org:masterfrom
ennerperez:feature/resx

Conversation

@ennerperez

Copy link
Copy Markdown
Contributor

To have a simpler path to translate the app using this contains a translations file format change, to be able to use IDE resx tools or even externals like Resx Manager

image
image

  • Resx Translations
  • Resource Dictionary Runtime Converter

@love-linger

Copy link
Copy Markdown
Collaborator

I would to keep it "simple and straightforward" rather than "IDE integration friendly" - Developers can use any tool, such as a plain text editor, to view and modify it.

Of course, maybe I'm wrong. Therefore, the PR will not be closed, and I hope that more people will participate in the discussion of which option is more reasonable.

@ennerperez

Copy link
Copy Markdown
Contributor Author

Yes, I understand. In that particular case, VSCode has an extension to handle resx; the same is true for Rider and the same for Visual Studio, and for those who don't want to use any IDE there is an external tool. (https://github.com/dotnet/ResXResourceManager)

In any case, developers can still use a simple text editor to modify translations; there is no need to use an IDE. Resx is a simple XML file, the same as AXAML (Resource Dictionary)

image

I want to include more languages, and I think it is more .NET standard and easy to control translations using resx format.

Let me know any other thoughts you have.

@love-linger

Copy link
Copy Markdown
Collaborator

I'm very sorry. I didn't take a closer look at the format of the Resx file. In this way, it seems that using Resx does not introduce other inconvenient problems.

One more thing, I'd like to put these translations into the Resources directory (where the rest of the project's resources are placed together). Or move the other resources from Resources directory to Assets directory?

@love-linger
love-linger merged commit 5f0a1c5 into sourcegit-org:master Mar 18, 2024
@love-linger

Copy link
Copy Markdown
Collaborator

Nice job!

@love-linger

love-linger commented Mar 18, 2024 •

Copy link
Copy Markdown
Collaborator

@ennerperez I have a problem:

when publishing with AOT, the publish directory has two sub directories, zh and en, for satellite resources (https://learn.microsoft.com/en-us/dotnet/core/extensions/create-satellite-assemblies) . I found that when I deleted these two directories directly, it had no effect on the program (localization still worked, and I didn't see anything else that affected the software).

Does it means that publishing with AOT has linked these two assemblies into the final exe file? Should I delete these two directories in final release package or not?

@ennerperez

Copy link
Copy Markdown
Contributor Author

Looks like satelites are not requiered by the aot published version.

@love-linger

Copy link
Copy Markdown
Collaborator

Yes, I think so too, but not for sure

@love-linger

love-linger commented Apr 6, 2024 •

Copy link
Copy Markdown
Collaborator

I'm sorry, but I'm going to re-use axaml resources to manage localization. After using ResX for some time, I feel that the ResX way is very inconvenient for me in certain situations.

  1. Sort. If the prefixes are the same, in most cases they are translations of the same module. The order of the content of the output file is very necessary.
  2. In fact, ResX is relatively dependent on tool configuration. For example, the generation of Locales.Designer.cs, etc.
  3. I often need to switch between Windows/Linux/macOS, and sometimes add and modify Locales on one platform to quickly see if some designs are satisfactory. The ResX approach makes me feel very inconvenient, compared to the previous way of using VSCode + axaml. It's NOT as simple as I thought before

1llum1n4t1s pushed a commit to 1llum1n4t1s/Komorebi that referenced this pull request May 16, 2026
…O(n²) (P1#25/27/30)

/rere 10 人分隊レビュー P1 バッチ 9: 独立修正可能な 3 件を実施。設計判断系
(#18/sourcegit-org#23/sourcegit-org#33) は別 PR/別セッションへ deferred。

【sourcegit-org#30】AvatarManager._resources の無制限増殖を防止
- ConcurrentQueue<string> _resourceInsertionOrder で挿入順を保持
- 1024 件超過時に EvictionBatchSize(256) 件を FIFO で削除
- デフォルトアバター (GitHub/Unreal) はエビクション対象外
- 既存の 3 つの追加点 (Request/SetFromLocal/Download完了) を InsertCachedAvatar に統一

【sourcegit-org#25】HistoryFilter.Pattern の長さ制限 (DoS 防御)
- SanitizePattern に MaxPatternLength=1024 のクランプを追加
- LINQ Where による文字フィルタ前に切り詰めて O(n) を保証
- Git ref 名は仕様上 255 byte 程度が現実的なので通常利用への影響なし

【sourcegit-org#27】Anthropic tool_use ループの O(n²) DeepClone を排除
- JsonObject.Remove("messages")/Remove("tools") で attach/detach パターンに変更
- messages 配列が伸びるたびに毎回 DeepClone していた CPU/メモリコストを削減
- ToJsonString による serialize 1 回 + Remove 2 回で済む

#20 (Velopack rollback 手順) は TROUBLESHOOTING.md シナリオ C に既存記載があるためスキップ。
sourcegit-org#34 (Preferences .bak) は既に実装済み (Save/Load 双方に backup 経路あり)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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