kotlin-faker icon indicating copy to clipboard operation
kotlin-faker copied to clipboard

Provide ability to extend a dictionary

Open abouquet opened this issue 3 years ago • 3 comments

I want to extends a localized dictionnary (not creating a new one) as provided ones are not fully localized

Is there any way to do this ?

abouquet avatar Apr 23 '21 14:04 abouquet

Hi @abouquet , How would you want to extend it without modifying the contents of the .yml file? Right now the only way to extend the existing dictionaries is by modifying them and bundling with the application.

I've had an idea in mind to make it possible to provide new dict files (or even "extensions" to existing ones) outside of the application. But that requires some major refactoring and re-implementation, and I simply do not have much time for that right now, so that has not evolved pas an issue yet (https://github.com/serpro69/kotlin-faker/issues/8)

But maybe I'm misunderstanding what is it you're asking for. If you can provide some more details and examples, it could be that it's possible to do in an easy way now.

serpro69 avatar Apr 26 '21 06:04 serpro69

That is indeed what I am wanting : beeing able to provide new translation by adding new yaml file in the classpath for example. We can also think about an API to provide translated words by code (we some kind of builder pattern)

No matter how we can extend the translation, it would be great not to be forced to repackage the library with updated yaml files :)

abouquet avatar May 08 '21 05:05 abouquet

Thanks for the input. Good to know I'm not the only one who finds such functionality useful :) Will pick this up.

serpro69 avatar May 10 '21 08:05 serpro69

Hi @abouquet , Kotlin-Faker 2.0 will have functionality that allows to create custom data generators (see here for details: https://serpro69.github.io/kotlin-faker/wiki/custom-data-provider/ ) It seems to me that that's something that covers this request as well, hence I'm going to close it. But feel free to re-open if you feel like that doesn't fully cover your description. I'd like to add as much as possible to kotlin-faker before releasing the next major version.

serpro69 avatar Mar 30 '24 16:03 serpro69