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

Enhanced Internationalization Support (i18n) #1285

Closed
mdaneri opened this issue Apr 9, 2024 · 3 comments · Fixed by #1320
Closed

Enhanced Internationalization Support (i18n) #1285

mdaneri opened this issue Apr 9, 2024 · 3 comments · Fixed by #1320

Comments

@mdaneri
Copy link
Contributor

mdaneri commented Apr 9, 2024

Overview:

Pode, as a PowerShell library, currently lacks robust internationalization (i18n) support, which limits its usability for users across different linguistic and cultural backgrounds. This feature request aims to enhance Pode's internationalization capabilities to ensure a seamless experience for users worldwide, by enabling localization directly within PowerShell scripts.

Feature Description:

  1. Locale Support: Enhance Pode to support locale-specific configurations, allowing users to use their preferred language and regional settings within their PowerShell scripts.

  2. Text Localization: Enable the localization of text strings within Pode scripts, allowing developers to provide translations for messages, prompts, and other textual content based on the user's selected language.

  3. Date and Time Formatting: Provide functions or utilities within Pode to format dates, times, and other temporal data according to different regional conventions and preferences.

  4. Number Formatting: Support localized number formatting to display numerical data in formats familiar to users based on their selected locale.

Benefits:

  • Global Accessibility: Enhancing internationalization support will make Pode accessible to a wider global audience, enabling users from different regions to utilize PowerShell scripts effectively.

  • Improved User Experience: Users will be able to interact with PowerShell scripts written with Pode in their preferred language and cultural context, leading to a more intuitive and user-friendly experience.

Implementation Plan:

Text Localization Integration: Implement functionality to support the localization of text strings within Pode scripts, leveraging PowerShell's localization features where applicable.

Target Pode version 2.11.0

@Badgerati
Copy link
Owner

I agree we need better i18n support, I've even been thinking about this for Pode.Web as well - currently in this Project item which is just idea note taking at the moment: https://github.com/users/Badgerati/projects/3/views/1?filterQuery=lan&pane=issue&itemId=52901033

In Pode.Web my thinking was to use .psd1 files for different language ISO codes, and they are all key/value pairs. The appropriate one can be loaded either via a pwsh function or intelligently based on browser/system settings. Pode.Web would also come pre-loaded with existing key/value files for en which could be overridden.

I've been thinking that that feature could be something done within Pode itself, so it's a reusable feature for other people/extension modules.

Obviously there are other places, like DateTimes and Numbers which can't be done by a simple .psd1 config file. And we need to be careful to localise everything, as some things - like request logging - do have to confirm to logging standards, if using the inbuilt logging.

What ideas have you had around this, keen to make sure we don't conflict and duplicate logic in Pode/Pode.Web 😄

@mdaneri
Copy link
Contributor Author

mdaneri commented Apr 13, 2024

My idea was to implement what suggested by https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_script_internationalization?view=powershell-7.4

using Import-LocalizedData -BindingVariable msgTable
Numbers are not really a thing for Pode. I think only FileBrowser is impacted
DateTimes we have to localize where needed and move the rest to UTC

@mdaneri
Copy link
Contributor Author

mdaneri commented Apr 13, 2024

Can you set 2.11 as milestone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants