I have a question which is surely answered somewhere but I didn’t find it.
I want to create an language specific admin gui for a nc plugin.
The admin should be able to define menu texts for different languages.
In my case the admin defines the texts dynamically, evtl. user specific.
I. e. the texts have to be translated on the fly or the admin has to provide the language specific texts himself.
Is there a best practice that the admin provides the text by using nc existing routines?
E.g. enhancing nls files?
Thanks for your answer. I’m a complete newbie to nc, php, therefore I didn’t understand the solution.
I cannot expect you to explain the code. Perhaps you can give me a more conceptual answer.
Where does nc store the admin’s texts? (files, DB, …)
In case of files: Are the files reread for every access or only at nc startup?
I know Java’s NLS concept. Text’s are stored in language/country specific NLS files.
Texts are selected via package name/ID and the language/country parameters.
If the specific NLS file does not exist, a default file is taken.
I think for user specific texts which should be changable effectivly within a user session, the file concept is not the best way (don’t know whether files are cached, read at every access, …).
DB should be better. Does nc offers sth for this purpose? Do one have to implement it himself?
Your app has to take care of storing and reading the value.
Since we are in php (non-persistent) I would recommend to store it in the database (like the terms of service app does).