Include language files in theme

For support and discussion related to templates, themes, and imagesets in phpBB 3.1.
Get Involved
Locked
User avatar
Zoker
Registered User
Posts: 134
Joined: Tue Jan 07, 2014 8:26 pm
Name: Florian

Include language files in theme

Post by Zoker » Wed Feb 24, 2016 2:44 pm

Hi there,

is there any good way to include language files within a theme?
Or is it necessary to create an extension for that?

Thank you!

PS: I'm not talking about using language variables, I want to add own strings ;)

User avatar
david63
Registered User
Posts: 16190
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Include language files in theme

Post by david63 » Wed Feb 24, 2016 2:48 pm

Zoker wrote:is there any good way to include language files within a theme?
Not that I have ever seen.
Zoker wrote:I'm not talking about using language variables, I want to add own strings
Not sure what you mean by that, perhaps if you could explain what it is that you are trying do we might be able to help. The whole purpose of language files is that they contain variables that are translatable - if it is only for your own use then you could just enter the text into the template
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Zoker
Registered User
Posts: 134
Joined: Tue Jan 07, 2014 8:26 pm
Name: Florian

Re: Include language files in theme

Post by Zoker » Wed Feb 24, 2016 2:52 pm

david63 wrote:Not sure what you mean by that, perhaps if you could explain what it is that you are trying do we might be able to help. The whole purpose of language files is that they contain variables that are translatable - if it is only for your own use then you could just enter the text into the template
I want to add text to my theme. And since I don't want to "hardcode" it into my template files, I'm searching for a good way to do it. for extensions I can use the "language" folder and place the strings in there, but I need a way for themes.

User avatar
david63
Registered User
Posts: 16190
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Include language files in theme

Post by david63 » Wed Feb 24, 2016 2:54 pm

Easiest way in that case is to just add your language into an existing language file (depends on where you want to use the language as to which one) - just remember to copy them over whenever you do an update.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Zoker
Registered User
Posts: 134
Joined: Tue Jan 07, 2014 8:26 pm
Name: Florian

Re: Include language files in theme

Post by Zoker » Wed Feb 24, 2016 3:00 pm

But since I want to provide this files to my customers, it's not a good way to overwrite existing files, is it?

User avatar
david63
Registered User
Posts: 16190
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Include language files in theme

Post by david63 » Wed Feb 24, 2016 3:07 pm

If you do not want to go down the extension route to add the language you could probably do it using jquery which you could include with your style and load into the template(s)
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Re: Include language files in theme

Post by Arty » Wed Feb 24, 2016 3:23 pm

If you add it via css it will be easy to translate.

You can use content rule of pseudo element:

Code: Select all

.whatever:after {
 content: 'Text';
}
then translation can overwrite it in theme/{language}/stylesheet.css
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

Locked

Return to “[3.1.x] Styles Support & Discussion”