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

[NEW-FEATURE] Implement use of resx for translation of PLC strings #144

Merged

Conversation

PTKu
Copy link
Contributor

@PTKu PTKu commented Mar 29, 2023

closes #143

This PR adds the possibility of translation of twin project texts

  • [breaking] the ixc now creates csproj files with names that comply with C# identifier requirements (due to resx generator using the project name by default to generate resources) files with name using '-' will now use instead '_' (e.g. ax-blazor-example.csproj will be ax_blazor_example.csproj).

  • ixr when no parameter provided will use current directory (ax) as the source (-x) and will retrieve the information about the output project from 'AXSharp.config.json' file. Providing output parameters will not alter the content of config file.

  • resource identifier creator was moved to AXSharp.Connector to share the same logic when creating and searching identifiers.

  • ixc now adds reference to assembly resources for plc string translation. We create new class PlcTranslator for each assembly (twin project) that provides Resources.PlcStringResources as default resource for given assembly. All members that can contain data eligible for localization reference the singleton of this 'PlcTranslator'.

  • updates docfx to 2.64.0

PTKu and others added 10 commits March 29, 2023 07:48
- [breaking] the ixc now creates csproj files with names that comply with identifier requirements (due to resx generator using the project name by default to generate resources) files with name using '-' will now use instead '_' (e.g. ax-blazor-example.csproj will be ax_blazor_example.csproj).
- ixr when no parameter provided will use current directory (apax) as the source (-x) and will retrieve the information about the output project from 'AXSharp.config.json' file. Providing output paramters will not alter the content of config file.
- resource identifier creator was moved to AXSharp.Connector to share the same logic when creating and searching indentifiers.
- resource injection for the translator [wip]
…lation

- we create new class `PlcTranslator` for each assembly (twin project) that provides `Resources.PlcStringResources` as default resource for given assembly. All members that can contain data eligible for localizaions refernce the singleton of this 'PlcTranslator'.
- adds translator to generated added properties of string type
- simplifies translator
- refactoring localization helper to AXSharp.Connector.Localization namespace
@PTKu PTKu marked this pull request as ready for review March 31, 2023 12:24
@PTKu PTKu merged commit eb5a5d6 into dev Mar 31, 2023
@PTKu PTKu deleted the 143-_NEW-FEATURE_Implement_use_of_resx_for_translation_of_PLC_strings branch March 31, 2023 12:29
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.

[NEW-FEATURE] Implement use of resx for translation of PLC strings
1 participant