Comments (3)
First, I'd like to note that JEDChecker issues a warning, not an error.
Actually, there are two problems with your approach:
-
Joomla uses a single registry for translations, so one extension can overwrite strings of another extension. For example, one extension may translate "Czech" to "Tscheche" for de-DE locale, but the other does it to "Tschechin" or "Tschechisch". As a solution to this problem, it is highly recommended to use language keys with a unique prefix (e.g.
COM_MYEXTENSION__COUNTRY_CZECH
), but this, in turn, means that situations, where Joomla outputs the original key, should not occur. A standard approach to solve the problem, when the translation file does not contain some values, is to load the English translation file and then the current language translation file to overwrite values. If I'm not mistaken, in Joomla 3.2+ it is done automatically, and in older Joomla versions it had to be done manually. -
Translators may use third-party utilities to work with ini-files, and I'm not sure all of them support keys with spaces. For convenience, it is better to use a common denominator of avoiding PHP-specific things there (i.e., spaces in keys, the injection of constants into string values ββvia
${CONST}
, etc.).
from jedchecker.
JEDchecker clearly issues an error (message even is color coded in red):
I cannot folllow your arguments if an extension uses the joomla language interface correctly there may not be any collision - on the other hand I'm using only common country names (iso standard names), which cannot cause wrong translation. (e. g. "Germany" will always translate to "Deutschland")
I'm seeing these facts for my implementation:
- php does not report any errors, warnings or notices
- joomla does not report any errors, warnings or notices
- my extension (module) successfully uses the design of joomla's multi-language support (no errors, no warnings)
- sofar I did not find any joomla docs saying "white space in language keys is not allowed"
My implementation for german language support (as used right now) needs only 3 lines of code plus some entries in a language ini-file.
Therefore I think it would be silly to comletely change design and coding only to make JEDChecker happy.
from jedchecker.
Hmm, I've found original reason to make it error. There was the Specification of language files page on docs.joomla.org with the following requirements:
- The KEY is now defined to be
- without any whitespace. All whitespace shall be converted into a underscore '_'
- All KEY's in the frontend shall include a prefix of the extension
I don't know why this page was removed without a replacement.
PS. My opinion is that, in general, all rules except of "core" ones (Info, License, XML Manifests, XML Files, GPL License) should trigger warnings instead of errors. But at the same time I think that "error" is a proper level in this particular case: using of a raw text instead of a prefixed keys in language file is ok for local development, but not for JED, because it may lead to conflicts between different extensions.
from jedchecker.
Related Issues (20)
- Usability Issues: UI based on colors HOT 3
- Support of the JED Submission Error Codes HOT 12
- False positive: Pattern found#24 - PHP execution operator: backticks (``) HOT 6
- False Positive ERROR: PH2, \defined('_JEXEC') or die;
- False positive: Extensions that use 'Joom' HOT 6
- False positive The JEXEC security check was not found in this file. HOT 18
- [Suggestion] - Extend the readme on Crowdin Project
- False positive PH2 error HOT 4
- Dependency Dashboard
- JED Checker 2.4.1 extension downloaded from the JED differs from development repository
- Language file is not loaded, when lang prefix is missing. HOT 1
- JEXEC security check HOT 6
- [PHP 8.1] Deprecated: trim(): Passing null to parameter #1 ($string) in rules/xmlinfo.php on line 322 HOT 2
- Warning: syntax error, unexpected '{' or '!' HOT 1
- NOTICE: Node <folder> has unknown attribute 'plugin' is wrong? HOT 2
- Not recognized in XML: <name>language KEY</name> HOT 3
- JEDchecked in Joomla 3.10.12 failed: TypeError: Failed to fetch HOT 17
- [J5] JED Checker extension only works with b/c plugin enabled HOT 2
- JEF Checker 2.4.2 has no checksum HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jedchecker.