Skip to content

Language code for Denmark is 'da' #642

Closed

Description

@robosoul

Describe the bug
Country code for Denmark is 'dk'. Language code for Denmark is 'da'.

From here: https://docs.oracle.com/cd/F19385_01/books/OnDemMigrTool/language-codes.html#c_Language_Codes_and_Their_Corresponding_Languageand_Country__apq1024117

DAN | da_DK | da | Danish | Denmark

We have inconsistent faker yaml configs for Denmark

 % head -3 src/main/resources/da-DK.yml 
da-DK:
  faker:
    address:

% head -3 src/main/resources/dk.yml    
dk:
  faker:
    passport:

To Reproduce

    public static void main(String[] args) {
        Faker faker = new Faker(new Locale("da", "DK"));

        for (int i = 0; i < 10; i++) {
            System.out.println(faker.passport().valid());
        }
    }

Produces following values:

675721431
A73519666
Z21455537
Y08878014
Y01691978
C48328077
X80809531
A72483039
X37609985
288690866

Only the first and the last from above are valid for DK.

Expected behavior
Per "[0-9]{9}" we should only get 9 digit passport values for Denmark.

Versions:

  • OS: OSX
  • JDK 8/11
  • Faker Version 1.7

dk.yml should be removed and following:

dk:
  faker:
    passport:
      valid: "[0-9]{9}"

should be added to da-DK.yml

Additional context
Add any other context about the problem here.

Activity

  1. robosoul commented on Jan 20, 2023

    @robosoul
    ContributorAuthor

    @bodiam - I can see you added dk.yml back in September. Was this on purpose or an oversight ? Thanks, Luka

  2. added a commit that references this issue on Jan 20, 2023
  3. added a commit that references this issue on Jan 20, 2023
  4. bodiam commented on Jan 20, 2023

    @bodiam
    Contributor

    @bodiam - I can see you added dk.yml back in September. Was this on purpose or an oversight ? Thanks, Luka

    I have no idea :) Was there any hint in the commit message?

  5. robosoul commented on Jan 20, 2023

    @robosoul
    ContributorAuthor

    Nothing special, something like "Making passport numbers pattern country specific". Could be it was an oversight. It's in da-DK now, no dk here:
    https://www.science.co.il/language/Codes.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions