mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-15 12:57:38 -04:00
Merge pull request #10171 from kobergj/FixEmailTranslations
Fix email translationPath and docu
This commit is contained in:
5
changelog/unreleased/fix-email-translations.md
Normal file
5
changelog/unreleased/fix-email-translations.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Bugfix: Fix email translations
|
||||
|
||||
Email translations would not use custom translation pathes. This is now fixed.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10171
|
||||
@@ -51,15 +51,15 @@ Consider that embedding images via a CID resource may not be fully supported in
|
||||
The `notifications` service has embedded translations sourced via transifex to provide a basic set of translated languages. These embedded translations are available for all deployment scenarios.
|
||||
|
||||
In addition, the service supports custom translations, though it is currently not possible to just add custom translations to embedded ones. If custom translations are configured, the embedded ones are not used. To configure custom translations,
|
||||
the `NOTIFICATIONS_TRANSLATION_PATH` environment variable needs to point to a base folder that will contain the translation files. This path must be available from all instances of the notifications service, a shared storage is recommended. Translation files must be of type [.po](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files) or [.mo](https://www.gnu.org/software/gettext/manual/html_node/Binaries.html). For each language, the filename needs to be `translations.po` (or `translations.mo`) and stored in a folder structure defining the language code. In general the path/name pattern for a translation file needs to be:
|
||||
the `NOTIFICATIONS_TRANSLATION_PATH` environment variable needs to point to a base folder that will contain the translation files. This path must be available from all instances of the notifications service, a shared storage is recommended. Translation files must be of type [.po](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files) or [.mo](https://www.gnu.org/software/gettext/manual/html_node/Binaries.html). For each language, the filename needs to be `notifications.po` (or `notifications.mo`) and stored in a folder structure defining the language code. In general the path/name pattern for a translation file needs to be:
|
||||
|
||||
```text
|
||||
{NOTIFICATIONS_TRANSLATION_PATH}/{language-code}/LC_MESSAGES/translations.po
|
||||
{NOTIFICATIONS_TRANSLATION_PATH}/{language-code}/LC_MESSAGES/notifications.po
|
||||
```
|
||||
|
||||
The language code pattern is composed of `language[_territory]` where `language` is the base language and `_territory` is optional and defines a country.
|
||||
|
||||
For example, for the language `de`, one needs to place the corresponding translation files to `{NOTIFICATIONS_TRANSLATION_PATH}/de/LC_MESSAGES/translations.po`.
|
||||
For example, for the language `de`, one needs to place the corresponding translation files to `{NOTIFICATIONS_TRANSLATION_PATH}/de/LC_MESSAGES/notifications.po`.
|
||||
|
||||
<!-- also see the userlog readme -->
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
logger.Fatal().Err(err).Str("addr", cfg.Notifications.RevaGateway).Msg("could not get reva gateway selector")
|
||||
}
|
||||
valueService := settingssvc.NewValueService("com.owncloud.api.settings", grpcClient)
|
||||
svc := service.NewEventsNotifier(evts, channel, logger, gatewaySelector, valueService, cfg.ServiceAccount.ServiceAccountID, cfg.ServiceAccount.ServiceAccountSecret, cfg.Notifications.EmailTemplatePath, cfg.Notifications.DefaultLanguage, cfg.WebUIURL)
|
||||
svc := service.NewEventsNotifier(evts, channel, logger, gatewaySelector, valueService, cfg.ServiceAccount.ServiceAccountID, cfg.ServiceAccount.ServiceAccountSecret, cfg.Notifications.EmailTemplatePath, cfg.Notifications.DefaultLanguage, cfg.WebUIURL, cfg.Notifications.TranslationPath)
|
||||
|
||||
gr.Add(svc.Run, func(error) {
|
||||
cancel()
|
||||
|
||||
@@ -50,7 +50,7 @@ func NewEventsNotifier(
|
||||
logger log.Logger,
|
||||
gatewaySelector pool.Selectable[gateway.GatewayAPIClient],
|
||||
valueService settingssvc.ValueService,
|
||||
serviceAccountID, serviceAccountSecret, emailTemplatePath, defaultLanguage, ocisURL string) Service {
|
||||
serviceAccountID, serviceAccountSecret, emailTemplatePath, defaultLanguage, ocisURL, translationPath string) Service {
|
||||
|
||||
return eventsNotifier{
|
||||
logger: logger,
|
||||
@@ -64,6 +64,7 @@ func NewEventsNotifier(
|
||||
emailTemplatePath: emailTemplatePath,
|
||||
defaultLanguage: defaultLanguage,
|
||||
ocisURL: ocisURL,
|
||||
translationPath: translationPath,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ var _ = Describe("Notifications", func() {
|
||||
cfg := defaults.FullDefaultConfig()
|
||||
cfg.GRPCClientTLS = &shared.GRPCClientTLS{}
|
||||
ch := make(chan events.Event)
|
||||
evts := service.NewEventsNotifier(ch, tc, log.NewLogger(), gatewaySelector, vs, "", "", "", "", "")
|
||||
evts := service.NewEventsNotifier(ch, tc, log.NewLogger(), gatewaySelector, vs, "", "", "", "", "", "")
|
||||
go evts.Run()
|
||||
|
||||
ch <- ev
|
||||
@@ -275,7 +275,7 @@ var _ = Describe("Notifications X-Site Scripting", func() {
|
||||
cfg := defaults.FullDefaultConfig()
|
||||
cfg.GRPCClientTLS = &shared.GRPCClientTLS{}
|
||||
ch := make(chan events.Event)
|
||||
evts := service.NewEventsNotifier(ch, tc, log.NewLogger(), gatewaySelector, vs, "", "", "", "", "")
|
||||
evts := service.NewEventsNotifier(ch, tc, log.NewLogger(), gatewaySelector, vs, "", "", "", "", "", "")
|
||||
go evts.Run()
|
||||
|
||||
ch <- ev
|
||||
|
||||
Reference in New Issue
Block a user