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

Change Province Name To MultiLang Object #98

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

amirzenoozi
Copy link
Contributor

According To the Previous Talk, I think it's better if we had an object instead of a single string to show the province name in numberPlate

@ali-master
Copy link
Member

May you write a few samples of what did you do? and Do you know what is the side-effects of this function in production for users who already have used this function?

@amirzenoozi
Copy link
Contributor Author

amirzenoozi commented Jul 20, 2021

@ali-master Actually it will be a really big change for users that use ProvinceName in their project, but I think it's better than prev format because in this change we can have multiple names for a single ProvinceCode but in the current version we have to have a single name for each ProvinceCode

i change this:

// Current plateInfo
{
  "type": "Car",
  "template": "PLATE_TEMPLATE",
  "province": "مرکزی",
  "category": "شخصی",
  "details": {
    "firstTwoDigits": "12",
    "nextThreeDigits": "145",
    "provinceCode": "47",
    "plateCharacter": "ب"
  }
}

to:

// New plateInfo
{
  "type": "Car",
  "template": "PLATE_TEMPLATE",
  "province": {
    "fa": "مرکزی", 
    "en": "Markazi",
  },
  "category": "شخصی",
  "details": {
    "firstTwoDigits": "12",
    "nextThreeDigits": "145",
    "provinceCode": "47",
    "plateCharacter": "ب"
  }
}

// New Format for More Than One Province
{
  "type": "Car",
  "template": "PLATE_TEMPLATE",
  "province": {
    "fa": ["تهران", "البرز"], 
    "en": ["Tehran", "Alborz"],
  },
  "category": "شخصی",
  "details": {
    "firstTwoDigits": "12",
    "nextThreeDigits": "145",
    "provinceCode": "21",
    "plateCharacter": "ب"
  }
}

if we want to remove the side-effects we have to keep province key with prev format and add a new key like provinceDetails to the final object, what do you think?

@ali-master
Copy link
Member

it would be better if we prevent changing the current API and add new properties as well as you want.

@ali-master ali-master added enhancement New feature or request New feature Something new labels Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request New feature Something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants