Pode icon indicating copy to clipboard operation
Pode copied to clipboard

Enhanced Internationalization Support (i18n)

Open mdaneri opened this issue 10 months ago • 3 comments

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

mdaneri avatar Apr 09 '24 20:04 mdaneri

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 😄

Badgerati avatar Apr 13 '24 18:04 Badgerati

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 avatar Apr 13 '24 19:04 mdaneri

Can you set 2.11 as milestone

mdaneri avatar Apr 13 '24 19:04 mdaneri