snipcart / snipcart-localization-v2

Localization files for Snipcart's shopping cart v2
https://docs.snipcart.com/v2/configuration/localization
MIT License
30 stars 114 forks source link

Locale de not found, falling back to en (warrning message) #45

Closed Umair-Munir closed 7 years ago

Umair-Munir commented 7 years ago

I have changed language from en to de. I have done all the configurations given in "Snipcart Documentation". But I am still getting warnings in logs whenever the page is reloaded.

locale-warnings

I have file "de.js" loaded in my application. But, It is still unable to find that file and try to search for en . These are parts of my configurations In HTML file

      <html lang="de">

in "de.js" file the code looks something like this

   Snipcart.execute('bind', 'app.ready', function () {
      Snipcart.execute('registerLocale', 'de', {
          first_name: "Vorname",
           last_name: "Nachname",
            ........................

How can I prevent this warnings?

couellet commented 7 years ago

You can add the following code snippet:

<script>
  document.addEventListener('snipcart.ready', function() {
    Snipcart.DEBUG = false;
  });
</script>

It will disable warning messages.

Umair-Munir commented 7 years ago

Is there any way to resolve these warning messages instead of hiding messages in console? Whenever, I try to use locale of any language other than "en" these warnings messages are displayed in console.

couellet commented 7 years ago

I just merged the pull request you sent this week. Should be live in the next couple of minutes! It should solve the issue here.

Umair-Munir commented 7 years ago

Yes, almost all the warning messages have been removed. But I am still getting this warning message when I try to use locale other than en.

screen shot 2017-03-25 at 6 38 04 pm
Mattrushka commented 6 years ago

I am facing the same issue and error message as @Umair-Munir Are there any updates on this? It does not seem to affect any functionality but for people who are new to Snipcart the error message might be confusing. Maybe re-open the issue?

datune commented 6 years ago

@couellet Yup, same problem for me. Can we please fix this?

benrom commented 6 years ago

Snipcart.DEBUG = false; does not prevent the console from being filled with those language related logs.