faker
faker copied to clipboard
Random greek alphabet letter
Clear and concise description of the problem
As a user I want to generate a random greek letter so that I can prepend this to a name of an object.
I would like to have the option to get a short or a long version of a letter (α or 'alpha').
Maybe Α and άλφα could also somehow get returned.
Suggested solution
const cameraName = 'Camera ' + faker.<?>.greekLetter({ format: 'long' });
const cameraName2 = faker.helpers.mustache('Camera {{greekLetter({format:"long"})}}');
I'm open to other ideas
Alternative
No response
Additional context
https://en.wikipedia.org/wiki/Greek_alphabet#Letters
AFAICT you use the greek characters to name or enumerate things. Why dont you use numbers or letters instead?
If we add support for greek characters, what about russian letters or chinese word letters or math symbols?
AFAICT you use the greek characters to name or enumerate things. Why dont you use numbers or letters instead?
If we add support for greek characters, what about russian letters or chinese word letters or math symbols?
Yeah, I also thought about these. So maybe we could implement:
faker.locale = 'el'
faker.<?>.letter(...)
The above was just my current use-case, I'm open to broader suggestions
Hmmmm... Not sure if something like this would be a little better:
faker.<?>.letter({locale: 'el'})
This way we can do several calls in a row using a different locale config instead of having to change locale between each call. If we decide to go forward with that, adding an option to return uppercase characters would also be nice.
Also, could we extend random.alpha for this use case instead of adding a new function ?
Potentially changed requirements:
faker.xyz.letter({ case: lower | upper | name })
lower =>'a' upper => 'A' name => 'Aey'(?)
TBD: The name in which locale? Alpha vs άλφα.
Thank you for your feature proposal.
We marked it as "waiting for user interest" for now to gather some feedback from our community:
- If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
- If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.
We will start the implementation based on:
- the number of votes (:+1:) and comments
- the relevance for the ecosystem
- availability of alternatives and workarounds
- and the complexity of the requested feature
We do this because:
- There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
- Every feature we add to faker has "costs" associated to it:
- initial costs: design, implementation, reviews, documentation
- running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors
I don't think this should require an el locale. Greek letters are often used when a neutral name is needed (eg think of covid variants)