Code Monkey home page Code Monkey logo

laravel-lang-country's People

Contributors

darkaonline avatar jayenne avatar stefro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-lang-country's Issues

lang_country not stored in DB as expected

Hello,
I have followed the instructions to install this package and expected the lang_country to be stored in the new user.lang_country table of my database but it remains NULL even after numerous logins and cache dumps etc.

Should it be added to the db or do I need to add it manually on login somehow?

date example in readme is incirrect.

Hi,
the example date in the readme file is incrrect. I don't know if this is a typo of something that reflects the code too...

you have: jan 1th 2018; 1 jan 2018

it should be: jan 1st 2018; 1st jan 2018
--also: you would only really drop the st/nd/rd/th if the month is a number too.

en-GB date format incorrect

Loving this but, as a Brit we always use day-month-year for our dates. It should really be like en-AU. More at https://en.wikipedia.org/wiki/Date_format_by_country

{
"country": "GB",
"lang": "en",
"name": "English",
"date_numbers": "d/m/Y",
"date_numbers_full_capitals": "DD/MM/YYYY",
"date_words_without_day": "j F Y",
"date_words_with_day": "l j F Y",
"date_birthday": "j F",
"time_format": "h:i a",
"emoji_flag": "🇬🇧"
}

xx_YY json lang file not loaded

Detailed description

Hi !
I'm building an app for en-US, en-CA and fr-CA regions/languages.

Generally speaking, en-CA and en-US could share the same en.json file, but there are a few times where i'll need them to be different. Reading your doc, and the issue #13 , I thought this would be easy, but that doesn't seem to work. Maybe i'm getting something wrong.

Context

My current locale is fr-CA

I have a ressources/lang/fr-CA.json file that looks like this:
{ "en-CA": "Canada (English)", "fr-CA": "Canada (Français)", "en-US": "United States (English)" }

I created an override file in: ressources/lang/lang-country-overrides/fr-CA.json
in which I define "lang" as "fr-CA" instead of just "fr"
{ "country": "CA", "country_name": "Canada", "country_name_local": "Canada", "lang": "fr-CA", "name": "Canada (Français)", "date_numbers": "d/m/Y", "date_numbers_full_capitals": "DD/MM/YYYY", "date_words_without_day": "j F Y", "date_words_with_day": "l j F Y", "date_birthday": "j F", "time_format": "h:i a", "emoji_flag": "🇨🇦", "currency_code": "CAD", "currency_symbol": "$", "currency_symbol_local": "$CAD", "currency_name": "Canadian Dollar", "currency_name_local": "Dollars Canadien" }

In a component I call {{ __($lang['lang_country']) }}

This should look at ressources/lang/fr-CA.json for the current lang_country key, which is fr-CA and display Canada (Français), but I only get fr-CA, so the translation did not happen.

If I rename ressources/lang/fr-CA.json to fr.json, it will work... So it seems, even if i've set lang in the override, that it's still looking for the fr.json file

I know the override file gets loaded because if I output name, I get Canada (Français) instead of the default name.
(I know I can use this as a workaround for what I originally intended to do, but the problem still persists and I'll still have a problem later when I want a different translation between en-CA and en-US)

So the override file seems to work, but then it fails to load the proper lang json file.

environment

This is Laravel 8 and this lib's latest release, 2.4.1

Thanks for your help :)

wrong ressource/lang loaded...

Hello,

I live in Belgium and I develop an application in french, dutch and I think about trying to sell this application in France.
Some words are different in French Belgian and French France...
In Belgium, the administration is called "Administration Communale" in French Belgian
And called "Mairie" in French France

I found your package.
It is very usefull !

But I have an issue and I think there's something I didn't understand correctly.

So in my ressource/lang, I have 3 folders (nl-BE, fr-BE and fr-FR)
In my session variable, i got 'lang' => 'fr', and 'lang_country' => 'fr-BE'
But the application load the 'fr' language...

In the README file, you wrote :

There will ALWAYS be set three sessions:
lang_country (example: nl-BE)
locale (examples: nl, es-CO)
locale_for_date (example: nl)

So I thought that locale would contain "fr-BE" instead of "fr"

here is my config/lang-country.php

return [

    'fallback' => 'fr-BE',

    'allowed' => [
        'nl-BE',
        'fr-BE',
        'fr-FR',
    ],

    'lang_switcher_middleware' => ['web'],

];

Did I miss something ?

Thanks for your help.

Francois

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.