-
Notifications
You must be signed in to change notification settings - Fork 282
Translation refactoring #1254
base: develop
Are you sure you want to change the base?
Translation refactoring #1254
Conversation
a7eb030
to
5139269
Compare
5139269
to
796fbeb
Compare
*/ | ||
public function load() | ||
{ | ||
$language = Kimai_Registry::getConfig()->getLanguage(); |
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.
To be honest, I think this is a breach of the responsibility principle.
From an architectural point of view the translation service should neither know nor care about a global registry.
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.
any better idea? the way how it was before is definitely not better.
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'm loading my own translations with that:
$this->translationData = Kimai_Registry::getTranslation();
$this->translationData->addTranslations('en', __DIR__ . '/');
$this->translationData->addTranslations('de', __DIR__ . '/');
Kimai_Registry::setTranslation($this->translationData);
if you have a better idea, I'm open for feedback ;)
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.
So, you are doing it like it was done before, but you find the way before not better?
Makes not much sense to me 😈
Yes my proposal stands: leave as it was before. There is absolutely no reason why the translation service should know about the registry. Only the registry is global and knows about all objects it handles.
Don't be offended - but I don't really care about Kimai 1. The code is crap and won't get better by any refactoring. If you like to move stuff around: do so!
working on a paid extension? |
jup. new admin configuration section which I provide as composer package with minimal adjustments to kimai core. That's why I want to load my own translation files instead of patching kimai core. |
Good idea to prepare the core to supply all necessary functions you need. |
Refactor translation loading in order to make it possible to load language files from additional packages as well.
Reason for this pull request: