themsaid / laravel-langman-gui Goto Github PK
View Code? Open in Web Editor NEWA GUI for managing JSON translation files in your laravel projects.
License: MIT License
A GUI for managing JSON translation files in your laravel projects.
License: MIT License
Hey everyone,
I've been trying to put more focus on this open source library for sometime but I keep failing. Sorry!
I'd like to ask for your help. Is there anyone willing to co-maintain this package? Or if you've been using it a lot for your work and you'd like to take over I'm happy to transfer the package to your account.
Thanks everyone, hope the package helped make your life easier :)
i just installed the packaged put the service provider published the files and went to www.myapp.com/langman
what is the issue, please help?
Hi,
Langman currently doesn't ignore backslashes. It scans if you\'re not the one
and cannot recognize "if you're not the one"
in strings.
I suppose json implementation doesn't provide pluralization?
Definitely not an issue for your great tool, just asking...
When I run a fresh scan with this package it only finds strings that are echoed using the __
method and not strings using the @lang
method.
Simply changing @lang('Back to overview)
to {{ __('Back to overview') }}
and then running a scan will make the string appear among the keys.
I can work around this by using the __
method but it's a shame I have to manually change this now in all my views.
Is this expected behaviour or am I missing something?
Laravel 5.4, this package 0.3.1
Hi,
Search and find the whole app for unused strings takes so much time. Can you do that by showing unused strings which defined in languages?
Hi, maybe i did something wrong but when i go to /langman route i see i dont have JSON lang files and i can create it, after that into selecting language LINK i have double lang file name. When i try scan files i getting information about langman found new keys but this is not added for this lang. If i add something to en.json file manually and scan it, everything working perfect, but when i create new lang file manually(i can't create new file from langman GUI) i getting internal 500 error into browser console. If i add to new created file json array {}
item is scan, but is not added to my new language.
If you can let me know step by step how can i add new translations and how i should work with langman.
//Edit: I fixed something from this buggs, tommorow i will add PR with this and maybe some improvments :D
On the initial scan of a fresh install, I got this error:
local.ERROR: array_key_exists() expects parameter 2 to be array, null given {"exception":"[object] (ErrorException(code: 0): array_key_exists() expects parameter 2 to be array, null given at /home/ubuntu/leadingre_com/vendor/themsaid/laravel-langman-gui/src/Manager.php:96)
[stacktrace]
Once I manually created the first key and translation, the scan worked and found all the existing keys in my views. Adding $keys = [] beneath the scan $output = []; should solve it.
Hi Mohammed,
I have a fresh install of everything and a single view with the following:
__("This is a test")
Clicking on the scan I can see that the endpoint does return the correct value:
["This is a test"]
but the Vue component throws the following error:
langman.js:42763 Uncaught TypeError: Cannot read property 'This is a test' of undefined at Vue$3.addNewKey (langman.js:42763) at Vue$3.boundFn [as addNewKey] (langman.js:33189) at _.forEach.key (langman.js:42835) at arrayEach (langman.js:14459) at Function.forEach (langman.js:23281) at Object.$.post.done.response (langman.js:42834) at fire (langman.js:6979) at Object.fireWith [as resolveWith] (langman.js:7109) at done (langman.js:12934) at XMLHttpRequest.<anonymous> (langman.js:13176)
Are you getting it also on a fresh install?
Hi,
Please show placeholders (e.g. :name
) in a different background.
Thanks for the great package. :)
Is there anyways I can make changes to the views? as I want to give facility to update languages to my team, so i want to make it feel as part of my own app.
Hi Themsaid, thanks for your work in L, Im trying your tool, and when I scan, Im getting that is getting this as key:
')}}</th>
<th class="border-top-0">{{__('Created
in reality, theres 2 keys, like this:
<th class="border-top-0">{{__('Client')}}</th>
<th class="border-top-0">{{__('Created')}}</th>
Appreciate all the help
Hi, there is a problem I face with your library because my Laravel project is in a subfolder with a naked /public/ folder visible in the URL, so the post requests are going to http://myhost.com/langman/save instead of http://myhost.com/subgolder/public/langman/save.
I think you must change your codes $.post('/langman/scan', {_token: langman.csrf})
and add the full APPURL prefix.
Thanks.
It would be nice if keys were editables :)
Hi,
It's annoying to see multiple alerts due to multiple clicking on the scan button.
https://github.com/themsaid/laravel-langman-gui/blob/master/src/Manager.php#L151-L163
$pattern =
// See https://regex101.com/r/jS5fX0/5
'[^\w]'. // Must not start with any alphanum or _
'(?<!->)'. // Must not start with ->
'('.implode('|', $functions).')'.// Must start with one of the functions
"\(".// Match opening parentheses
"[\'\"]".// Match " or '
'('.// Start a new group to match:
'.+'.// Must start with group
')'.// Close group
"[\'\"]".// Closing quote
"[\),]" // Close parentheses or new parameter
;
If there has space around the arguments in translate function,this pattern con not match .
like: __( 'langman' ).
$pattern =
// See https://regex101.com/r/jS5fX0/5
'[^\w]'. // Must not start with any alphanum or _
'(?<!->)'. // Must not start with ->
'('.implode('|', $functions).')'.// Must start with one of the functions
"\(".// Match opening parentheses
"\s".
"[\'\"]".// Match " or '
'('.// Start a new group to match:
'.+'.// Must start with group
')'.// Close group
"[\'\"]".// Closing quote
"\s".
"[\),]" // Close parentheses or new parameter
;
It is very interesting i think i will test.
thx
Hello,
I've done installation by instruction
composer require themsaid/laravel-langman-gui
Themsaid\LangmanGUI\LangmanServiceProvider::class
php artisan vendor:publish --provider=Themsaid\\LangmanGUI\\LangmanServiceProvider
I got response Publishing complete.
But nothing has been added to project public folder and config folder. Langman home page is without style and not working properly.
I use Laravel 5.5.
What can be wrong?
Hi,
Provide an option to set a new font, please. Persian characters don't seem right in Arial, Tahoma, and etc.
Hi, please work this package with laravel 7?
Hi,
After installing the component in a new Laravel project and publishing the config, I have this error in browser:
Top menu:
Laravel Langman 0 Keys
Content:
There are no JSON translation keys in your project, start by creating json files for every language in your "resources/lang" directory. In case you have the files already created, you may now start adding keys or let Langman scan your project for lines to translate.
Environment:
OS: Windows 10 Pro
Laragon 2.2.2 (Apache 2.4.25, PHP 7.1.1)
Hi,
Plese support searching strings (not just keys) and replace all.
My langman install wasnt saving the new keys and updates, but after some digging i found its because of the ajax call to "/langman/save". Since i dont run my project on the top level, this call fails. Editing it to "langman/save" solves the problem.
Would it be possible to fix it? Or is there a way that i can do it? :-)
Also, thank you for the great package. Helps me save some serious time with the translation woes.
Hello,
are there any plans to add support for array files also?
This seems to be very promising.
Thanks
How can I use this package with a multidimensional array? Trans('file.array.sub.item')?
Hi,
You put strings into a fixed-width box. I think it's better to split the page into two vertical sections. the left one totally has strings and it fills whole its space and the other one is used to change strings as it is now.
Hi,
I noticed the config('langmanGUI.route_group_config.namespace') actually allows us to switch to our own Controller extending from the base Controller, but some private methods & attributes are prohibiting me from doing so.
private $disk;
private function getTranslationsFromFiles()
private function backup()
Please kindly make these 'protected', thanks very much.
Hi,
Please support for editing texts in RTL (i.e. Persian)
Hi,
Great package, thanks for that!
One tiny little hiccup for me is I was using {{ trans('Some string') }} and those didn't get picked up by the scan. I changed them all to __('') which were scanned properly.
That does leave me with quite a few {{ trans_choice(...) }} that are not getting scanned.
Do you plan on supporting those at some point?
Hi,
I have problem with making middleware for this package
1- code below in config/langmanGUI.php
'route_group_config' => [
'middleware' => ['role:Admin'],
'namespace' => 'Themsaid\LangmanGUI'
]
2- code above in vendor/config/langmanGUI.php
- result:
Spatie \ Permission \ Exceptions \ UnauthorizedException
User is not logged in.
3- adding code below to LangmanController.php
public function __construct()
{
$this->middleware(['role:Admin|Editor']);
}
- result:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method Themsaid\LangmanGUI\LangmanController::middleware()
any idea how to fix it?
Hi,
My base language is fa
, and the English lang path is /resources/lang/en/
but the tool continually says:
There are no JSON translation keys in your project, start by creating JSON
files for every language in your "resources/lang" directory.In case you have the files already created, you may now start adding keys or
let Langman scan your project for lines to translate.
Hi,
There're lots of modern scrollbars out there, please use one of them (specially auto-hide scrollbars) instead of default scrollbar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.