Laravel-Backpack / LangFileManager

A quick interface to edit Laravel language files, for Backpack.
http://backpackforlaravel.com
MIT License
92 stars 42 forks source link

Language codes should include culture code #1

Closed tabacitu closed 6 months ago

tabacitu commented 8 years ago

For example, "en-us" and "en-uk" instead of "en". In English it's ok, there's no big difference, but there are other countries that have big language differences from culture to culture, even different characters.

lloy0076 commented 7 years ago

@Ghitu - are you still intending to work on this?

lcloss commented 4 years ago

Hi! It will be great if I can use RFC 4646 instead of ISO-639-1 codes, adding a culture code like describe previously. Can I work on this feature? It is very easy, but need to increase abbr column to support the codes, and change request accordanly.

tabacitu commented 4 years ago

Hi @lcloss ,

Sorry for being so late to get to this. @Ghitu hasn't been active in this repo in a while now, I doubt he's interested in building it further. I personally don't use it either, but I know some people do, and it would probably be a good fix for them.

So it would be nice to have a solution for culture codes, yes. A PR would be most welcome - thank you!

(1) How do you plan to implement this? Just change the abbr attribute in the seeds to include the culture code? (2) Do you see any way in which this would conflict with Laravel's language features, and the locale and fallback_locale as defined in config/app.php? (3) There's another language-related feature in Backpack, which might help. In config/backpack/crud.php you can easily activate/deactivate languages by just uncommenting a line:

    'locales' => [
        // ...
        // "en_AS" => "English (American Samoa)",
        // "en_AU" => "English (Australia)",
        // "en_BE" => "English (Belgium)",
        // "en_BZ" => "English (Belize)",
        // "en_BW" => "English (Botswana)",
        // "en_CA" => "English (Canada)",
        // "en_GU" => "English (Guam)",
        // "en_HK" => "English (Hong Kong SAR China)",
        // "en_IN" => "English (India)",
        // "en_IE" => "English (Ireland)",
        // "en_JM" => "English (Jamaica)",
        // "en_MT" => "English (Malta)",
        // "en_MH" => "English (Marshall Islands)",
        // "en_MU" => "English (Mauritius)",
        // "en_NA" => "English (Namibia)",
        // "en_NZ" => "English (New Zealand)",
        // "en_MP" => "English (Northern Mariana Islands)",
        // "en_PK" => "English (Pakistan)",
        // "en_PH" => "English (Philippines)",
        // "en_SG" => "English (Singapore)",
        // "en_ZA" => "English (South Africa)",
        // "en_TT" => "English (Trinidad and Tobago)",
        // "en_UM" => "English (U.S. Minor Outlying Islands)",
        // "en_VI" => "English (U.S. Virgin Islands)",
        // "en_GB" => "English (United Kingdom)",
        // "en_US" => "English (United States)",
        // "en_ZW" => "English (Zimbabwe)",
        'en' => 'English',
        // ...
        // "pt_BR" => "Portuguese (Brazil)",
        // "pt_GW" => "Portuguese (Guinea-Bissau)",
        // "pt_MZ" => "Portuguese (Mozambique)",
        // "pt_PT" => "Portuguese (Portugal)",
        // "pt" => "Portuguese",
        // "pa_Arab" => "Punjabi (Arabic)",
        // "pa_Arab_PK" => "Punjabi (Arabic, Pakistan)",
        // "pa_Guru" => "Punjabi (Gurmukhi)",
        // "pa_Guru_IN" => "Punjabi (Gurmukhi, India)",
        // "pa" => "Punjabi",
        // "ro_MD" => "Romanian (Moldova)",
        // "ro_RO" => "Romanian (Romania)",
        'ro' => 'Romanian',
        // ...
    ],

The languages there allow you to translate items in those languages.

Since:

what do you @lcloss think about removing the Languages CRUD & the Languages table entirely? We could then get "which languages to translate" from the same config file that CRUD uses now, instead of the database. Personally I think that would:

But what do you think @lcloss ? Since providing culture code support is a breaking change, I think this is a great opportunity to do the above too. Right?

Thanks, cheers!

promatik commented 6 months ago

Hey everyone!

I'm happy to announce that we just released a new package Translation Manager. This new package uses Spatie Translation Loader under the hood and will eventually replace LangFileManager, since it works in a more predictable way, using the database to store translations.

I'll close this one for now, let's move our focus and efforts into improving Translation Manager 💪.