Create language FILE


I'm starting to have so much content that repeats itself, and if something needs changing I'm going to need to change it in 10 different areas, so I want to be able to create a new language file, let's say:
custom_file.ini
…and specify my own strings. Question is, how can I reference this custom file?
I could just add everything to global.ini but my OCD tells me I need to keep it all organized and separate.


{!custom_file:SOME_STRING}
The colon scoping here is a special syntax we support. It auto-loads the file if not already loaded.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Also to extend upon the original question Joe asked, how do we get this custom language file to be loaded with all the others so we don't need to use the !ref: in templates.


Is there a correct way to reference a language file via catalogue select lists? On the actual edit page it does show the translated DE string in the list dropdown as Mensch instead of Human when using {!KAL:HUMAN} as a list entry, but on the actual view screen it shows the raw Tempcode.
I'm afraid that I can't follow these words. Are we talking about the lists to select a catalogue when you add/edit a category or entry? Are we talking about fields with a field type of referencing a catalogue? Are we talking about fields with a field type of referencing a catalogue entry? Where exactly is the 'Tempcode being input? Because it couldn't be input in a reference to a catalogue or catalogue entry, that doesn't make sense. And it couldn't be the name of the catalogue itself, because codenames don't support special characters. And I just tested it in a catalogue title and it always showed as plain text.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Also to extend upon the original question Joe asked, how do we get this custom language file to be loaded with all the others so we don't need to use the !ref: in templates.
You could make a startup hook. Similar to this, but doing require_lang:
https://github.com/ocproducts/composr/blob/master/sources_custom/hooks/systems/startup/columns.php
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Hope this makes it clearer, when editing the catalogue entry it actually shows the string from the language file in the dropdown menu as "Human". Just doesn't show it correctly when viewing the entry. I realised I couldn't translate the list values directly when switching language, so I figured a language file might be the solution.
EDIT: Perhaps I could just leave the list values as English (not ideal for a multilanguage site) and can do something at the template level to display the translations from the respective language files when it comes to viewing the entries?
Last edit: by Adam Edington


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


