Open IgorFrancais opened 5 years ago
Hello,
if I understand you correctly, you just want a simple merge function, right? That shouldn't be hard to implement. :)
Yes:) Something like
and other, custom user's directory :)
Sorry for waiting so long... It's not as easy as I thought. I've stumpled across some issues here. When merging both directories (default and user directory), we also have to merge the language files. But we can't just merge the language files, because they are pre-sorted and merging would destroy the order.
Hello,
Now, when we create a library, we can use following ways:
new Language() - following directory will be used (by default): DIR . '/../../resources//.json';
We use other .json-files (take as an example, en language): 2.1 Create at any place folder $dirname=LanguageDetection/en/. 2.2 Put there your own text file: en.txt. 2.3 Train library:
2.4 Then use newly created/updated .json-file: LanguageDetection/en/en.json by:
new Language([], $dirname)
So, if we want to use default lang file, we should:
Request:
Not to copy-paste, it would be good have a possibility to use already existing en.json and newly created together, something like:
new Language([], $dirname, $useDefaultFile = true):
__DIR__ . '/../../resources/*/*.json'_)
and new - dirname