rasyidf / Rasyidf.Localization

Universal Localization Framework for WPF
https://rasyidf.github.io/Rasyidf.Localization/
MIT License
7 stars 5 forks source link

NullReferenceException issue #9

Closed ghost1372 closed 4 years ago

ghost1372 commented 4 years ago

hi why i get NullReferenceException ?

this is how i get string string test = LocalizationService.GetString("3", "Text", "آیا مایل به تغییر زبان برنامه هستید؟");

and this is my json

{
  "Languages": [
    {
      "EnglishName": "English",
      "CultureName": "United States",
      "Culture": "en-US",
      "RTL": "false"
    },
    {
      "EnglishName": "Persian",
      "CultureName": "Farsi",
      "Culture": "fa-IR",
      "RTL": "true"
    }
  ],

  "Data": [
    {
      "data": [
        {
          "Id": 2,
          "Header": {
            "en-US": "Exit",
            "fa-IR": "بستن"
          }
        },
        {
          "Id": 3,
          "Text": {
            "en-US": "do you want to change language?",
            "fa-IR": "آیا مایل به تغییر زبان برنامه هستید؟"
          }
        },
        {
          "Id": 10,
          "Content": {
            "en-US": "Subtitle",
            "fa-IR": "زیرنویس"
          }
        }
      ]
    }
  ]
}
rasyidf commented 4 years ago

I'm still searching the causes. thank you for your feedback

SKProCH commented 4 years ago

This usually occurs because localization is requested before it loads. I fix this and implement some cool features here, feel free to look and pull request (?) (i don't know how to interacts between gitlab and github)

rasyidf commented 4 years ago

well, thank you. I'll try to implement it into github also.

I don't know either how to interact between both.

SKProCH commented 4 years ago

Wait a few hours, I'll move it out on github

rasyidf commented 4 years ago

yes, thank you :)

rasyidf commented 4 years ago

Then i'll close this issue.