khoait / DCE.PCF

Power Apps PCF Controls Repository
GNU General Public License v3.0
40 stars 11 forks source link

Multi Language User Interface Support #95

Closed maerger closed 4 months ago

maerger commented 5 months ago

Describe Problem

We use the control in a German environment. It would be nice to have German translations for the controls end user interface

Suggest Solution/Expectation

Add the ability to configure wording of end user interface or translation at runtime (language resources)

maerger commented 5 months ago

I tried to contribute and solve this but did not manage to build the solution using msbuild. I'm quite new in react and PCF - maybe you have some rough description on how to init and build (I'm using vissual studio code or 2022)...

khoait commented 5 months ago

Thanks for your interest in the repo and glad to hear that the control is helpful! This helps to motivate me to put more effort in terms of features and variety of controls.

I'll look into language feature using supported web resources. Also review the build process with proper documentation.

I'll try to make some time for this. I'll let you know when it's available.

khoait commented 4 months ago

hi @maerger. I added language support by passing a URL to a .resx web resource to the new Language Pack Path property. Doing this is more flexible than storing each language pack in the control, so you don't need to worry about building the component.

you can use the English language pack here PolyLookup.1033.resx as the template, update the value in your language, and upload it to your environment as a web resource. use this VS Code extension to update the resx web resource https://marketplace.visualstudio.com/items?itemName=DominicVonk.vscode-resx-editor

Please try it in the new release here https://github.com/khoait/DCE.PCF/releases/tag/v1.0.5.0

Let me know what you think and feel free to open new issues if you find something odd.

I also update the readme with the build steps. Hope it helps when you want to contribute.

Cheers!

maerger commented 4 months ago

Hi @khoait I installed the new version in our dev environment and uploaded a german webresource like this: image

And put the path to my form: image

Seems that everything is working fine so far - thanks!

How would it be if we have an organization supporting multiple languages? I think language switch is supported by default on components if the webresources with the correct language code are provided.

khoait commented 4 months ago

@maerger we'll need to include language packs in the component for default multi languages support. It'll affect the size of the component, I'm not sure if we should unless there is a high demand for this. However, I have made it ready for if we want, we just include an additional language pack in the component and build. Let me know what you think.