This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 148
Is localization supported? #120
Comments
Maybe you can take a look here for the example https://github.com/bxcodec/faker/blob/master/example_with_tags_lang_test.go |
I saw that. But I cannot make it work. E.g., I need french names. I'm trying with this code: package main
import (
"fmt"
"github.com/bxcodec/faker/v3"
)
type SomeStructWithTags struct {
FirstName string `faker:"first_name lang=fre"`
FirstNameMale string `faker:"first_name_male lang=fre"`
FirstNameFemale string `faker:"first_name_female lang=fre"`
LastName string `faker:"last_name lang=fre"`
}
func main() {
a := SomeStructWithTags{}
err := faker.FakeData(&a)
if err != nil {
println(err)
}
fmt.Printf("%+v", a)
} It prints this:
Am I wrong? |
The only three languages supported with the code so far looks to be English, Chinese, and Russian. A "language" is defined with a rune range including exceptions and an informal language spec label. To support French additional characters would need to be added with a new language spec similar to the built-ins Lines 56 to 63 in 7460bf3
Support for ISO 639-1 or IETF locales such as |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I don't understand if languages (localization, l18n) is supported.
E.g.: can I generate fake french first names?
The text was updated successfully, but these errors were encountered: