[SOLVED]Does (Massage of the day) support other language?

Moderator: crythias

Post Reply
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

[SOLVED]Does (Massage of the day) support other language?

Post by BrianYin »

we wanna use massage of the day, but i found this module only support english.
can i add other language on this?
Thanks!!
Last edited by BrianYin on 13 Oct 2012, 10:04, edited 1 time in total.
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Does MOTD(Massage of the day) support other language?

Post by crythias »

I really could use a massage of the day.

If you look at Motd.dtl, you'll see that it will support anything you want, even translation with $Text{"Something here."}

Of interest (perhaps) is that you might consider arranging Motd.dtl to look as you desire with HTML markup and leaving $Text{"MOTDMESSAGE"} (as a literal example) as a placeholder, pretty much never touching Motd.dtl again.

Instead, for the language(s) you'd support, you'd create/modify in Kernel/Language/{yourlanguages}_Custom.pm something like the following:

Code: Select all

# --
# Kernel/Language/xx_Custom.pm - provides xx custom language translation
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: xx_Custom.pm,v 1.10 2009/02/16 10:18:52 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Language::en_Custom;

use strict;
use warnings;

use vars qw($VERSION);
$VERSION = qw($Revision: 1.10 $) [1];

sub Data {
    my $Self = shift;

    # $$START$$

    # own translations
    $Self->{Translation}->{'MOTDMESSAGE'}   = 'This is my message in English';

    # or a other syntax would be
    #    $Self->{Translation} = {
    #        %{$Self->{Translation}},
    #        # own translations
    #        'MOTDMESSAGE' => 'This is my message in English',
    #    };

    # $$STOP$$
}

1; 
These xx_Custom might be:
en_Custom.pm
en_GB_Custom.pm
en_CA_Custom.pm
es_Custom.pm
zh_CN_Custom.pm
or any other that you'd find listed in Kernel/Language.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

Re: Does MOTD(Massage of the day) support other language?

Post by BrianYin »

ok, i see.
you mean i put<p> &Text('This is a message here.') </p>in the motd.dtl
then go to the "'my language'.pm" translate this sentence to any other sentences i want by using my mother language.
Thanks a lot!
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
Post Reply