Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-standard language tags for "Belarusian" and "English (Pakistan)" locales #595

Closed
alx-mag opened this issue Jan 4, 2023 · 2 comments
Closed

Comments

@alx-mag
Copy link
Contributor

alx-mag commented Jan 4, 2023

Faker uses tags by and en-PAK for these locales. But the standard ones are be (or be-BY) and en-PK, see the standard locales list. These non-standard tags are usable with Faker but Java does not recognize them:

import java.util.Locale;

public class Test {

    public static void main(String[] args) {
        System.out.println(getLocaleDisplayName("by"));     // by
        System.out.println(getLocaleDisplayName("be-BY"));  // Belarusian (Belarus)
        System.out.println(getLocaleDisplayName("be"));     // Belarusian

        System.out.println(getLocaleDisplayName("en-PAK")); // pak
        System.out.println(getLocaleDisplayName("en-PK"));  // English (Pakistan)
    }

    static String getLocaleDisplayName(String languageTag) {
        return Locale.forLanguageTag(languageTag)
                .getDisplayName(Locale.ENGLISH);
    }
}

I think there should be added be.yml (or be-BY.yml) and en-PK.yml. The by.yml and en-PAK.yml can be left for backward compatibility.

@bodiam
Copy link
Contributor

bodiam commented Jan 8, 2023

Thanks for reporting! Would you be willing to do a PR for this? We could deprecate the non standard ymls, and remove them next release

@bodiam
Copy link
Contributor

bodiam commented Jan 12, 2023

I guess this can be closed now that #598 has been merged.

@bodiam bodiam closed this as completed Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants