Make localized by removing all previous locales #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This bit of code removes all the reinvented wheels of localization and replaces them with the langinfo method (optionally).
Since langinfo is pretty much standard at this point, there is no need to check for it, yet the code is written in a modular way to discard the feature if needed (for very limited environments perhaps, in the future).
The previous implementation had numerous problems:
Limitations of this implementation as of now:
wchar
must be replaced for a better handling as it helps the developers with sound and tested predefined unicode functions and utilities.fa_IR
locale is flawed and needs correction in some places (I may push on that front too) for exampleam_pm
is not set (glibc 2.41, "Persian does not have the 12-hour format"1!!??#?!?? and other questionable lines toblame
with no easy to access documentation on why). This is obviously not an issue with the code but since this code depends on that data, it's something to consider.All-in-all, having this and the Python code removed, the codebase tested and documented will breathe a new life into the project imho. Man pages, "docs" and many other bloated "features" in this code need to go and I will remove them in future commits.
This code is not extensively tested and requires careful reviewing. But since there are no automated tests, it's better to make these radical changes now rather than when wider adoption (#27) has taken place. Hence, I'll push this now so all of us can go on with more issues to solve.