-
Notifications
You must be signed in to change notification settings - Fork 234
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
[FEATURE] New ViewHelper which gets all translations from a certain language file #746
Conversation
@@ -0,0 +1,143 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
@@ -0,0 +1,142 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has mixed line endings; this may cause incorrect results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has mixed line endings; this may cause incorrect results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has mixed line endings; this may cause incorrect results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has mixed line endings; this may cause incorrect results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has mixed line endings; this may cause incorrect results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of line character is invalid; expected "\n" but found "\r\n"
Please squash it together |
abc953a
to
7fd1d2d
Compare
2182cc1
to
f447aae
Compare
This is an automated comment based on an automated formal commit review.Your pull request contains formal errors. Comments have been assigned to each commit in your pull request - please review and adjust. Feel free to ask for help if you need it! |
* @return string | ||
*/ | ||
protected function resolvePath($path) { | ||
if (FALSE === @is_file(GeneralUtility::getFileAbsFileName($path))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silencing errors is discouraged
This is an automated comment based on an automated formal commit review.Your pull request contains formal errors. Comments have been assigned to each commit in your pull request - please review and adjust. Feel free to ask for help if you need it! |
1 similar comment
* @param string $path | ||
* @return string | ||
*/ | ||
protected function resolvePath($path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change to method body:
$path = $this->arguments['path'];
$absoluteFileName = GeneralUtility::getFileAbsFileName($path);
if (FALSE === file_exists($absoluteFileName)) {
$extensionName = $this->resolveExtensionName($this->arguments['extensionName']);
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName);
$absoluteFileName = ExtensionManagementUtility::extPath($extensionKey, $path);
}
return $absoluteFileName;
And removing the $path
function argument, to make it homogenous with resolveExtensionName
.
Don't forget to import ExtensionManagementUtility.
Last batch of fixes and we're there! Meticulously reviewed to make sure you only need one more round of changes - when fixed, merging is approved (if anyone else from the team is reading this and sees the update before I do). Thanks again Cornel. Good stuff! |
Maybe use a proper editor and install editorconfig support. errors like whitespace at end of lines, line breaks, newline will go away. Editors supported http://editorconfig.org/#download |
@xf- |
@cbopp-art v8 is out |
bc29a83
to
b20b1b8
Compare
@NamelessCoder |
* @subpackage ViewHelpers\Resource | ||
*/ | ||
|
||
use \FluidTYPO3\Vhs\Utility\ViewHelperUtility; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this earlier, sorry! The class comment and the comment above the "use" statements are duplicates - the comment above should be used as class comment and the current class comment removed. And of course the "use" statements should then be moved above the class doc comment.
This will also take care of the documentation perspective. EXT:schemaker will use this documentation block when VHS docs are regenerated.
…tain language file
Right on! :) |
[FEATURE] New ViewHelper which gets all translations from a certain language file
This is a new ViewHelper which reads a language file and returns all the translations from.
A specific language key (e.g.
'de'
) can be defined to forces getting all translation from a different language instead of the current browsing language.Furthermore, this viewhelper provides the argument
jsonEncode
for returning all the translations as a JSON object instead of an array. This may could be useful if the translations need to be used in frontend (client side).Of course, there is already a separate Format/Json ViewHelper available. But in my opinion, it is more inconvenient for integrators to wrap this viewhelper tag once more just for reformating as well as it is worse from the performance side of view.