Laravel translations checker

Overview

Laravel translations checker

Latest Version on Packagist Total Downloads GitHub Actions

Ever feel that you are missing translations in some languages you support? Get users emailing you about weird strings on their screen?

Use the laravel translation checker and get direct feedback where and what translations you are missing!

Installation

You can install the package via composer:

composer require larswiegers/laravel-translations-checker

Usage

php artisan translations:check

Are your translations in a weird directory? use the --directory option like this:

php artisan translations:check --directory=resources/lang

What does the output look like?

The language nl (resources/lang/nl) is missing the file ( passwords.php )
Missing the translation with key: nl.passwords.reset
Missing the translation with key: nl.passwords.sent
Missing the translation with key: nl.passwords.throttled
Missing the translation with key: nl.passwords.token
Missing the translation with key: nl.passwords.user

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • error: foreach() argument must be of type array|object, int given on line 139

    error: foreach() argument must be of type array|object, int given on line 139

    https://github.com/LarsWiegers/laravel-translations-checker/blob/59c0c11000847c86dfafa6daecef13b418aeb77c/src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php#L133-L139

        } catch (\Exception $e) {
            dd([
                '$lines' => $lines,
                '$fileName' => $fileName,
            ]);
        }
    

    I checked the values and got this:

      array:2 [
        "$lines" => 1
        "$fileName" => "C:\[...]\lang\ca.json"
      ]
    

    I didn't pass any argument to the command and it's on a Laravel 9 project with the lang directory in the new place.

    opened by ordago 4
  • Makes test pass on Windows

    Makes test pass on Windows

    Using the basename function I get "test.php" Using Str::afterLast($str, '/') gets this: "one_missing_key\en\test.php"

    That's because the directory separator is different on Windows.

    Which is also the reason none of the test pass for me, I assume.

    opened by ordago 2
  • Bump phpunit/phpunit from 9.5.23 to 9.5.25

    Bump phpunit/phpunit from 9.5.23 to 9.5.25

    Bumps phpunit/phpunit from 9.5.23 to 9.5.25.

    Changelog

    Sourced from phpunit/phpunit's changelog.

    [9.5.25] - 2022-09-25

    Added

    • #5042: Support Disjunctive Normal Form types

    Fixed

    • #4966: TestCase::assertSame() (and related exact comparisons) must compare float exactly

    [9.5.24] - 2022-08-30

    Added

    • #4931: Support null and false as stand-alone types
    • #4955: Support true as stand-alone type

    Fixed

    • #4913: Failed assert() should show a backtrace
    • #5012: Memory leak in ExceptionWrapper
    Commits
    • 3e6f90c Prepare release
    • e4a88c5 Merge branch '8.5' into 9.5
    • 4fd448d Prepare release
    • 94fbab8 Merge branch '8.5' into 9.5
    • 0869792 Fix: Run 'tools/php-cs-fixer fix'
    • 2b5cb60 Enhancement: Enable and configure native_function_invocation fixer
    • 630725f Merge branch '8.5' into 9.5
    • 63bd717 Enhancement: Enable no_unneeded_import_alias fixer
    • 186775f Merge branch '8.5' into 9.5
    • fe26cfb Enhancement: Use no_trailing_comma_in_singleline instead of deprecated fixers
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 1
  •  Method Illuminate\Support\Str::replace does not exist.

    Method Illuminate\Support\Str::replace does not exist.

    at D:\wampp\www\paymoney\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:77

    73▕      */
     74▕     public static function __callStatic($method, $parameters)
     75▕     {
     76▕         if (! static::hasMacro($method)) {
    77▕             throw new BadMethodCallException(sprintf(
     78▕                 'Method %s::%s does not exist.', static::class, $method
     79▕             ));
     80▕         }
     81▕
    

    • Bad Method Call: Did you mean Illuminate\Support\Str::replaceLast() ?

    1 D:\wampp\www\paymoney\vendor\larswiegers\laravel-translations-checker\src\Console\Commands\CheckIfTranslationsAreAllThereCommand.php:78 Illuminate\Support\Str::__callStatic("replace")

    2 D:\wampp\www\paymoney\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 Larswiegers\LaravelTranslationsChecker\Console\Commands\CheckIfTranslationsAreAllThereCommand::handle()

    opened by Imtiaze 1
  • Does it work with json files ?

    Does it work with json files ?

    Hello ! Nice package. As I didn't see any mention in README, I was wondering if it works with https://laravel.com/docs/9.x/localization#using-translation-strings-as-keys ?

    Thanx

    opened by smknstd 1
  • Bump phpunit/phpunit from 9.5.23 to 9.5.26

    Bump phpunit/phpunit from 9.5.23 to 9.5.26

    Bumps phpunit/phpunit from 9.5.23 to 9.5.26.

    Changelog

    Sourced from phpunit/phpunit's changelog.

    [9.5.26] - 2022-10-28

    Fixed

    • #5076: Test Runner does not warn about conflicting options

    [9.5.25] - 2022-09-25

    Added

    • #5042: Support Disjunctive Normal Form types

    Fixed

    • #4966: TestCase::assertSame() (and related exact comparisons) must compare float exactly

    [9.5.24] - 2022-08-30

    Added

    • #4931: Support null and false as stand-alone types
    • #4955: Support true as stand-alone type

    Fixed

    • #4913: Failed assert() should show a backtrace
    • #5012: Memory leak in ExceptionWrapper
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • Bump orchestra/testbench from 6.25.0 to 6.25.1

    Bump orchestra/testbench from 6.25.0 to 6.25.1

    Bumps orchestra/testbench from 6.25.0 to 6.25.1.

    Release notes

    Sourced from orchestra/testbench's releases.

    v6.25.1

    Changes

    Testbench Changes

    Fixes
    • Remove bootstrap/cache/packages.php on vendor symlink event.
    Changelog

    Sourced from orchestra/testbench's changelog.

    6.25.1

    Released: 2022-10-11

    Changes

    Testbench Changes

    Fixes
    • Remove bootstrap/cache/packages.php on vendor symlink event.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • Bump orchestra/testbench from 6.24.1 to 6.25.0

    Bump orchestra/testbench from 6.24.1 to 6.25.0

    Bumps orchestra/testbench from 6.24.1 to 6.25.0.

    Release notes

    Sourced from orchestra/testbench's releases.

    v6.25.0

    Changes

    Testbench Changes

    Added
    • Added loadLaravelMigrationsWithoutRollback() and runLaravelMigrationsWithoutRollback() helpers.
    Changelog

    Sourced from orchestra/testbench's changelog.

    6.25.0

    Released: 2022-08-24

    Changes

    Testbench Changes

    Added
    • Added loadLaravelMigrationsWithoutRollback() and runLaravelMigrationsWithoutRollback() helpers.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • php artisan translations:unsed

    php artisan translations:unsed

    a killer feature (for me :-)) would be to find out which translations are not used in the code.

    Something like: php artisan translations: unsed

    There is no such thing even as an IDE plug-in like PHP Storm or Visual Code.

    So many times I have created translations that the maintenance of the site has made them useless.

    opened by roberto-otupacca 4
  • Fix command

    Fix command

    The idea:

    Include an --fix option that fixes the problems we find. Scenario: lang/

    • nl/
    • actions.php
    • en/
    • actions.php

    Lets say that both actions.php have this content: 'save' => 'save',

    But the en version also has: 'saving' => 'saving',

    But the nl version is missing it.

    This would, of course, be caught by the check command, but what if it asks you to type the translation for the missing

    translations if you use the --fix flag.

    What do you want for the translation for nl (actions.php) 'saving' => 'saving' (en version) to be?

    Where what you entered will be added to the nl version of the acitons.php file.

    Or something like that. Would that be useful?

    opened by LarsWiegers 2
Releases(v0.3)
  • v0.3(Dec 9, 2022)

    What's Changed

    • Update README.md by @LarsWiegers in https://github.com/LarsWiegers/laravel-translations-checker/pull/10
    • Bump orchestra/testbench from 6.24.1 to 6.25.0 by @dependabot in https://github.com/LarsWiegers/laravel-translations-checker/pull/14
    • Bump phpunit/phpunit from 9.5.23 to 9.5.26 by @dependabot in https://github.com/LarsWiegers/laravel-translations-checker/pull/18
    • Bump orchestra/testbench from 6.25.0 to 6.25.1 by @dependabot in https://github.com/LarsWiegers/laravel-translations-checker/pull/16
    • php 8.2 by @LarsWiegers in https://github.com/LarsWiegers/laravel-translations-checker/pull/19

    New Contributors

    • @dependabot made their first contribution in https://github.com/LarsWiegers/laravel-translations-checker/pull/14

    Full Changelog: https://github.com/LarsWiegers/laravel-translations-checker/compare/v0.2...v0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.2(Mar 14, 2022)

  • v0.1(Mar 11, 2022)

Owner
Lars Wiegers
Hey, Whatsup!
Lars Wiegers
Added Laravel functionality to Enlightn Security Checker

Added Laravel functionality to Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

Jorijn Schrijvershof 184 Oct 27, 2022
A package for simplifying the integration of a maker-checker approval process to your Laravel application.

prismaticoder/maker-checker-laravel The prismaticoder/maker-checker-laravel package is a comprehensive Laravel package that provides a flexible and cu

Jesutomiwa Salam 12 Jun 16, 2023
Proxy validation or Proxy checker. Command line version

Proxy Checker Proxy validation or Proxy checker Install on desktop : Install XAMPP Added environment variable system path => C:\xampp\php download the

Alex 3 Jan 21, 2022
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.9k Jan 2, 2023
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.

What is laravel charts? Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this li

Erik C. Forés 31 Dec 18, 2022
Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Sam Rapaport 46 Oct 1, 2022
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Octohook 13 May 16, 2022
Laravel Sanctum support for Laravel Lighthouse

Lighthouse Sanctum Add Laravel Sanctum support to Lighthouse Requirements Installation Usage Login Logout Register Email Verification Forgot Password

Daniël de Wit 43 Dec 21, 2022
Bring Laravel 8's cursor pagination to Laravel 6, 7

Laravel Cursor Paginate for laravel 6,7 Installation You can install the package via composer: composer require vanthao03596/laravel-cursor-paginate U

Pham Thao 9 Nov 10, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
Laravel Jetstream is a beautifully designed application scaffolding for Laravel.

Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.

The Laravel Framework 3.5k Jan 8, 2023
Laravel Larex lets you translate your whole Laravel application from a single CSV file.

Laravel Larex Translate Laravel Apps from a CSV File Laravel Larex lets you translate your whole Laravel application from a single CSV file. You can i

Luca Patera 68 Dec 12, 2022
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Hussein Feras 52 Jul 17, 2022
A Laravel extension for using a laravel application on a multi domain setting

Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi

null 658 Jan 6, 2023
Example of using abrouter/abrouter-laravel-bridge in Laravel

ABRouter Laravel Example It's a example of using (ABRouter Laravel Client)[https://github.com/abrouter/abrouter-laravel-bridge] Set up locally First o

ABRouter 1 Oct 14, 2021
Laravel router extension to easily use Laravel's paginator without the query string

?? THIS PACKAGE HAS BEEN ABANDONED ?? We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore.

Spatie 307 Sep 23, 2022