danhper / python-i18n

Easy to use i18n library for Python
https://pypi.python.org/pypi/python-i18n
MIT License
228 stars 45 forks source link

fix lists usages #23

Open ZRunner opened 4 years ago

ZRunner commented 4 years ago

Fix issue #22

danhper commented 3 years ago

Hi and thank you for taking the time to send a PR. Could give me a bit more background about the use case and why the normal dictionary structure is not sufficient, please? Thanks a lot!

ZRunner commented 3 years ago

Hey hello As I explained in my issue #22, supporting lists (or arrays, as you want) can be really helpful for values which don't require any key paring, like the list of months for example. Doing t(f"month.{i}") seems a bit less natural to me than t("month")[i], and the YAML syntax is way nicer (imo) when you don't have to specify values indexes. Months list is an example, but I'm sure you may find a tons of other possible usages... basically anything which can be represented as an ordered list.

MarcoG3 commented 3 years ago

Thanks @ZRunner, I also struggled with lists and your PR helped me. This functionality is a must-have for my current project!

sralloza commented 3 years ago

Is this going to be implemented at the end?

ZRunner commented 3 years ago

Is this going to be implemented at the end?

I really hope so, but the repo seems dead, which is kind of sad for a such useful lib. I'm thinking of eventually doing a fork later ^^

harveyives commented 3 years ago

Has there been any movement on this? This module is by far the best solution I've found, yet the list support is a dealbreaker for me unfortunately.

My use-case: I have a list of topics that are selected at random by a bot, it would be great to get these into an i18n friendly format that could be read in by python.

Is there any work I can do to move this along?

ZRunner commented 3 years ago

Well I guess for now you can just use my fork (https://github.com/ZRunner/python-i18n), it's the best we can do so far, until @danhper comes back...

(fyi you can install a package from git with the command pip install git+https://github.com/...)

Javinator9889 commented 3 years ago

It would be awesome if this feature gets implemented :)