Code Monkey home page Code Monkey logo

laravel-nova-lang's Introduction

Laraflash

Language files for Laravel Nova translated into 40+ languages.

This is not an official Laravel package, but is built from community contributions. If you are able to help by submitting a new language, reviewing an existing language, or adding missing keys, please read our contributing guidelines and raise a PR.


You can take part in #Hacktoberfest by contributing to our repo during the month of October. Read more.


Installation

composer require coderello/laravel-nova-lang

Usage

Publish Command

  • Publish translations for one language:

    php artisan nova-lang:publish de
  • Publish translations for multiple languages (comma-separated):

    php artisan nova-lang:publish de,ru
  • Publish translations for all available languages:

    php artisan nova-lang:publish --all
  • Publish translations and override existing files:

    php artisan nova-lang:publish de,ru --force

Aliases

The language codes chosen for the files in this repository may not match the preferences for your project. You can use the ‑‑alias option to publish locales using a different filename.

  • Publish translations for one language with an alias, using the simple format {alias}:

    php artisan nova-lang:publish de --alias=de-DE

    This will publish the file de-DE.json.

  • Publish translations for multiple languages with multiple aliases, using the format {locale}:{alias} (comma-separated):

    php artisan nova-lang:publish de,ru,fr --alias=de:de-DE,ru:ru-RU

    This will publish the files de-DE.json, ru-RU.json and fr.json (no alias).

  • Aliases can also be used with the --all flag:

    php artisan nova-lang:publish --all --alias=es:es-ES

    You do not need to supply an alias for every locale that is to be published, only those that you wish to override.

  • Here are some example aliases for common use cases:

    • Use Chinese with scripts instead of regions: zh-CN:zh-Hans,zh-TW:zh-Hant
    • Default to Brazilian Portuguese over European: pt:pt-PT,pt-BR:pt
    • Default to Serbian in Latin script over Cyrillic: sr-Latn:sr,sr:sr-Cyrl
  • There is also an ‑‑underscore or ‑U switch to publish locales with an underscore separator instead of a hyphen. This can be used in combination with aliases.

Development Commands (debug mode only)

You must have the app.debug config option set to true for these commands to be available:

Missing Command

This command is to assist contributors to find any untranslated keys for their chosen language.

A stub JSON file will be created at storage_path('app/nova-lang/missing/{locale}.json'). You can copy those keys into the resources/lang/{locale}.json language file in your own fork of the repository, translate them and create a pull request.

  • Output missing translation keys for one or more languages:
php artisan nova-lang:missing de,ru
  • Output missing translation keys for all languages:
php artisan nova-lang:missing --all

Reorder Command

This command is to assist contributors to ensure that the translation keys for their chosen language are in the same order as the en.json source file from Laravel Nova.

If you have imported the keys you are translating into a translation string management tool, the original order of the keys may be lost when you reexport the file. This makes the diff difficult to read because it will highlight all keys rather than just those which you have added or updated.

A new JSON file will be created at storage_path('app/nova-lang/reorder/{locale}.json'). You can copy the contents of this file to resources/lang/{locale}.json in your fork before you raise a PR.

  • Output reordered translation keys for one or more languages:
php artisan nova-lang:reorder de,ru
  • Output reordered translation keys for all languages:
php artisan nova-lang:reorder --all

Stats Command

This command is to assist maintainers to update the completeness of each language and list of contributors in this README file.

A README.excerpt.md and contributors.json file will be created at storage_path('app/nova-lang'). You can copy those files into your own fork of the repository and create a pull request.

  • Output list of languages, lines translated and contributors:
php artisan nova-lang:stats

Ensure you have created a GitHub personal access token and saved it as a GITHUB_TOKEN_NOVALANG env variable in your master Laravel application in order to download the most recent contributions.

Available Languages

Note: There is no need to update the count of translated strings and add your username below, as this is done by script when your PR is merged.

Total languages 40
Total lines translated 16040 (92.8%)

Code Language Translated files Lines translated Thanks to
en English php json 401 (100%) taylorotwell, bonzai, davidhemphill, jbrooksuk, themsaid, kitbs, dillingham
af Afrikaans php json 401 (100%) medlion
bs Bosnian php json 401 (100%) hajro92
nl Dutch php json 401 (100%) DannyvdSluijs, happyDemon, steefmin, jschram, sebastiaanspeck, daniel-de-wit
fr French php json 401 (100%) MarceauKa, Yannik-Slym, InfinityWebMe, kitbs, shaffe-fr, Arryan, KillianH
de German php json 401 (100%) pille1842, shieraki, kitbs, tobiasthaden, dakira
ja Japanese php json 401 (100%) Tsumagari
nb Norwegian Bokmål php json 401 (100%) einar-johan
ro Romanian php json 401 (100%) BTeodorWork, dtix, alexgiuvara
ru Russian php json 401 (100%) hivokas, sanasol, den1n, deadem, soulshockers, estim
es Spanish php json 401 (100%) kitbs, joebordes, ajmariduena, iksaku, IGedeon, Arryan, kennyhorna, xcodinas, dgtal, rodrigore
sv Swedish php json 401 (100%) tanjemark, slackernrrd
uk Ukrainian php json 401 (100%) soulshockers, Ostap34JS, osbre
pt‑BR Brazilian Portuguese php json 396 (98.8%) henryavila, pedrofurtado, eduardokum, saulo-silva, chbbc, IgorDePaula
hu Hungarian php json 396 (98.8%) milli05, bgeree
ar Arabic php json 394 (98.3%) saleem-hadad, danyelkeddah, Arryan
zh‑CN Chinese (Simplified) php json 389 (97%) jcc, zacksleo, masterwto
zh‑TW Chinese (Traditional) php json 389 (97%) CasperLaiTW, zacksleo
fa Farsi php json 376 (93.8%) alirezamirsepassi, mziraki
pt Portuguese php json 372 (92.8%) Pedrocssg
it Italian php json 352 (87.8%) (unknown), manuelcoppotelli, dejdav
ca Catalan php json 351 (87.5%) joebordes
eu Basque php json 350 (87.3%) JonPaternain
hr Croatian php json 348 (86.8%) defart, walaski
cs Czech php json 348 (86.8%) walaskir, walaski
da Danish php json 348 (86.8%) olivernybroe
fil Filipino php json 348 (86.8%) granaderos
fi Finnish php json 348 (86.8%) Krisseck
ka Georgian php json 348 (86.8%) akalongman
hi Hindi php json 348 (86.8%) bantya
id Indonesian php json 348 (86.8%) dvlwj
sr Serbian (Cyrillic) php json 348 (86.8%) marjanovicsteva
sr‑Latn Serbian (Latin) php json 348 (86.8%) marjanovicsteva
sk Slovak php json 348 (86.8%) hejty
sl Slovenian php json 348 (86.8%) morpheus7CS
tr Turkish php json 348 (86.8%) bureken, sineld, dilekuzulmez
lt Lithuanian php json 347 (86.5%) minved
pl Polish php json 347 (86.5%) Strus, marekfilip, wiktor-k
tl Tagalog php json 346 (86.3%) rcjavier
bg Bulgarian php json 345 (86%) BKirev

Missing Languages

The following languages are supported for the main Laravel framework by the excellent caouecs/laravel-lang package. We would love for our package to make these languages available for Nova as well. If you are able to contribute to any of these or other languages, please read our contributing guidelines and raise a PR.

Parity with caouecs/laravel-lang 37/73 (50.7%)

Code Language Lines translated
sq Albanian 0 (0%)
az Azerbaijani 0 (0%)
bn Bangla 0 (0%)
be Belarusian 0 (0%)
zh‑HK Chinese (Hong Kong) 0 (0%)
et Estonian 0 (0%)
gl Galician 0 (0%)
de‑CH German (Switzerland) 0 (0%)
el Greek 0 (0%)
he Hebrew 0 (0%)
is Icelandic 0 (0%)
kn Kannada 0 (0%)
kk Kazakh 0 (0%)
km Khmer 0 (0%)
ko Korean 0 (0%)
lv Latvian 0 (0%)
mk Macedonian 0 (0%)
ms Malay 0 (0%)
mr Marathi 0 (0%)
mn Mongolian 0 (0%)
cnr Montenegrin 0 (0%)
ne Nepali 0 (0%)
nn Norwegian Nynorsk 0 (0%)
ps Pashto 0 (0%)
sc Sardinian 0 (0%)
si Sinhala 0 (0%)
sw Swahili 0 (0%)
tg Tajik 0 (0%)
th Thai 0 (0%)
tk Turkmen 0 (0%)
ur Urdu 0 (0%)
ug Uyghur 0 (0%)
uz‑Cyrl Uzbek (Cyrillic) 0 (0%)
uz‑Latn Uzbek (Latin) 0 (0%)
vi Vietnamese 0 (0%)
cy Welsh 0 (0%)

laravel-nova-lang's People

Contributors

alirezamirsepassi avatar arryan avatar bkirev avatar dejdav avatar den1n avatar dtix avatar einar-hansen avatar igordepaula avatar iksaku avatar joebordes avatar jschram avatar killianh avatar kitbs avatar marceauka avatar milli05 avatar minved avatar mjperpinosa avatar mziraki avatar olivernybroe avatar pierolin avatar pille1842 avatar sanasol avatar shaffe-fr avatar soulshockers avatar strus avatar tanjemark avatar tsumagari avatar wiktor-k avatar xcodinas avatar zacksleo avatar

Watchers

 avatar  avatar

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.