Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Feature: Dynamic property names #78

Open
ChrisBAshton opened this issue Sep 4, 2018 · 0 comments
Open

Feature: Dynamic property names #78

ChrisBAshton opened this issue Sep 4, 2018 · 0 comments

Comments

@ChrisBAshton
Copy link

My team would really benefit from dynamic properties, e.g.

__(`title-${chosenSport}`);

Currently we have to work around the issue by manually maintaining a list of translations at compile time, e.g.

const sportNames = {
    athletics: __('title-athletics'),
    aquatics: __('title-aquatics'),
    ...etc
}

...and then referring to the stored object instead of using __:

sportNames[chosenSport];

We regularly run into this issue and believe it is better solved inside the i18n plugin than in application code. It looks like an attempt at dynamic property names was being worked on in #42, but this turned into a 'plurals' feature in #58, which is not the problem we're trying to solve.

It may be possible for us to work on a PR for you if you are open to the feature idea. Thanks for your time 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant