New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create:plugin command to include languages scaffold #2833
Comments
Possibly solved by this plugin: https://octobercms.com/plugin/bnb-scaffoldtranslation |
Any reason why we couldn't look at merging the changes into core? |
This has been discussed before. Languages are not supported by default for accessibility reasons, including it makes the output look too scary for beginners. |
How about enabling it as a flag passed to the create:plugin scaffolding command? |
Totally on board with that idea so long as the default is non translated scaff. |
@LukeTowers can this same be done for create:controller command? |
@Samuell1 sure. I don't have the time to implement it myself right now unless someone wants to sponsor it but feel free to go for it. |
After searching there is no way to use if statements in stub files. Then this needs to be created in one or in 2 separate files. Maybe moving stub files to twig parse will be better idea. |
Credit to @Samuell1. Implements a potential resolution for octobercms/october#2833.
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling. |
@Samuell1 stub files now support Twig |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling. |
@Samuell1 @CptMeatball is this still desired? |
@LukeTowers Yeah |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
|
@Samuell1 you interested in submitting a PR for a flag to add this? |
@LukeTowers Yes i am but it will take a lot of time to rework all scafollding files. But now i dont have time to do it. |
@Samuell1 all right. I'll leave it open for now, but we'll close it the next time the github bot comments in a month and then we can re-open it when you have time to implement it. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. |
When creating plugins with the
create:plugin
artisan command, it creates a number of files to start working on your own plugin. Currently the command creates two filesupdates/version.yaml
andplugin.php
with the correct name spacing etc.To increase the quality and extensibility of all new plugins this command should also include a language directory with the default's locale language file (
lang/{locale}/lang.php
).The advantage of this approach is that plugins that use this can be easily extended without being modified. People just need to add the language files for their locales and make a PR in the repo. It's easier for the author, third party developers and most importantly it should give end users a more solid user experience in the long run as well.
Changes in the current scaffold
Currently, the scaffold generates placeholder names and descriptions for in
plugin.php
. These need to be changed to support the default use of the language file.Plugin.php
Additions to the current scaffold
lang/{locale}/lang.php
Caveats
Default locale
When generating a plugin with language files, the OctoberCMS default language should be taken into account. In
/config/cms.php
the default language for the CMS is set. This language can be used as the default when generating the language directory.Language file markup
A standard set of language files has to be included to generate the correct placeholder text for the
description
as this is the only "real text" that is generated by the current command. This means that for all of the possible languages the stringNo description has been provided yet...
should be added in the translation of October.Expected/Current Behaviour
Expected behavior
$ php artisan create:plugin acme.corporation
Bootstraps plugin directory with:
Actual behavior
$ php artisan create:plugin acme.corporation
Bootstraps plugin directory with:
The text was updated successfully, but these errors were encountered: