Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature: todo languages#173

Closed
caouecs wants to merge 1 commit into
php-censor:masterphp-censor/php-censor:masterfrom
caouecs:todo_languagesCopy head branch name to clipboard
Closed

Feature: todo languages#173
caouecs wants to merge 1 commit into
php-censor:masterphp-censor/php-censor:masterfrom
caouecs:todo_languagesCopy head branch name to clipboard

Conversation

@caouecs

@caouecs caouecs commented Apr 25, 2018

Copy link
Copy Markdown
Contributor

Contribution type

new feature on resources

Description of change

The script generates a file ( todo_languages.md ) with differences between English version and others languages. It is inspired by the script of Laravel-lang.

To generate the file :

php script/todo.php

Comment thread script/todo.php
$current = $this->getTranslations("{$this->basePath}/{$language}");

foreach ($default as $key => $values) {
foreach ($values as $key2 => $value2) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Avoid unused local variables such as '$value2'.

Comment thread script/todo.php
@@ -0,0 +1,141 @@
<?php

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPCS: A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 7 and the first side effect is on line 141.

Comment thread script/todo.php
*
* @internal Inspired from Laravel-lang project.
*/
class TodoGenerator

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPCS: Each class must be in a namespace of at least one level (a top-level vendor name)

@corpsee

corpsee commented Apr 25, 2018

Copy link
Copy Markdown
Member

Thanks @caouecs!

  1. Could you wrap the script (TodoGenerator class) by console command (Something like: ./bin/console php-censor:check-localizations) and print result to console output instead of file?

  2. Could you check strings which equel to english too (Not only missing strings)?

@corpsee corpsee added this to the 1.0 milestone Apr 25, 2018
@corpsee corpsee changed the title feature: todo languages Feature: todo languages Apr 25, 2018
@caouecs

caouecs commented Apr 25, 2018

Copy link
Copy Markdown
Contributor Author
  1. No problem
  2. I will do an option to see or not equality

@corpsee

corpsee commented Apr 25, 2018

Copy link
Copy Markdown
Member

OK, thank you!

@caouecs caouecs closed this May 1, 2018
@caouecs

caouecs commented May 1, 2018

Copy link
Copy Markdown
Contributor Author

I did a new pull request ( #174 )

@caouecs caouecs deleted the todo_languages branch May 1, 2018 11:32
@corpsee corpsee removed this from the Version 1.0.* (patch) milestone May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.