This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jonathan.pellerin8361
jonathan.pellerin8361

Hi all,

I would like to know if there's a way to have default translations that can be shared by all plugins.

eg. Most of my modules use the same label for similar columns in the database. So I would like to know if there is a way that I could write all of these labels in one centralized file so that I don't have to include them in each and every module I develop.

Thank you

fenerli
fenerli

You could make a plugin to host shared content and language data and then access it in other plugins:

plugins/jonathan/shared/lang/xx/lang.php

jonathan.shared::lang.columns.name

If the plugins have a dependency on each other or you think it is feasible to make them instead of having a "shared" plugin, you can access the language data from another plugin. For example, in a hypothetical plugin "yotta":

plugins/jonathan/yotta/lang/xx/lang.php

jonathan.epsilon::lang.fruit.apple

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.