[vhffs-dev] [584] Added gettext_noop function to register translated strings declared in arrays .

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 584
Author:   beuss
Date:     2007-04-20 16:56:48 +0000 (Fri, 20 Apr 2007)

Log Message:
-----------
Added gettext_noop function to register translated strings declared in arrays.
Added Makefile and Makefile.in to svn:ignore in vhffs-compat.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Functions.pm

Property Changed:
----------------
    trunk/vhffs-compat/


Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm	2007-04-19 20:05:49 UTC (rev 583)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm	2007-04-20 16:56:48 UTC (rev 584)
@@ -43,33 +43,46 @@
 my $password;
 srand(time ^ $$);
 
+=pod
+
+=head2 gettext_noop
+
+Utility function used to indicate translatable string without calling
+real C<gettext> (use it if you declare arrays of translatable strings).
+
+=cut
+
+sub gettext_noop {
+    return $_[0];
+}
+
 my @STATUS_STRINGS;
-$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_VALIDATION] = 'Waiting for validation';
-$STATUS_STRINGS[Vhffs::Constants::VALIDATION_REFUSED] = 'Validation refused';
-$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_CREATION] = 'Waiting for creation';
-$STATUS_STRINGS[Vhffs::Constants::CREATING_ERROR] = 'Creation error';
-$STATUS_STRINGS[Vhffs::Constants::CREATED] = 'Created';
-$STATUS_STRINGS[Vhffs::Constants::ACTIVATED] = 'Activated';
-$STATUS_STRINGS[Vhffs::Constants::SUSPENDED] = 'Suspended';
-$STATUS_STRINGS[Vhffs::Constants::SUSPENDED_BEFORE_DELETED] = 'Suspended before deletion';
-$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_MODIFICATION] = 'Waiting for modification';
-$STATUS_STRINGS[Vhffs::Constants::MODIFICATION_ERROR] = 'Modification error';
-$STATUS_STRINGS[Vhffs::Constants::MODIFICATION_APPLIED] = 'Modification applied';
-$STATUS_STRINGS[Vhffs::Constants::TO_DELETE] = 'Will be deleted';
+$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_VALIDATION] = gettext_noop('Waiting for validation');
+$STATUS_STRINGS[Vhffs::Constants::VALIDATION_REFUSED] = gettext_noop('Validation refused');
+$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_CREATION] = gettext_noop('Waiting for creation');
+$STATUS_STRINGS[Vhffs::Constants::CREATING_ERROR] = gettext_noop('Creation error');
+$STATUS_STRINGS[Vhffs::Constants::CREATED] = gettext_noop('Created');
+$STATUS_STRINGS[Vhffs::Constants::ACTIVATED] = gettext_noop('Activated');
+$STATUS_STRINGS[Vhffs::Constants::SUSPENDED] = gettext_noop('Suspended');
+$STATUS_STRINGS[Vhffs::Constants::SUSPENDED_BEFORE_DELETED] = gettext_noop('Suspended before deletion');
+$STATUS_STRINGS[Vhffs::Constants::WAITING_FOR_MODIFICATION] = gettext_noop('Waiting for modification');
+$STATUS_STRINGS[Vhffs::Constants::MODIFICATION_ERROR] = gettext_noop('Modification error');
+$STATUS_STRINGS[Vhffs::Constants::MODIFICATION_APPLIED] = gettext_noop('Modification applied');
+$STATUS_STRINGS[Vhffs::Constants::TO_DELETE] = gettext_noop('Will be deleted');
 
 
 my @TYPES_STRINGS;
-$TYPES_STRINGS[Vhffs::Constants::TYPE_USER] = 'User';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_GROUP] = 'Group';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_HTTPD] = 'Webarea';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_REPOSITORY] = 'Download Repository';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_MYSQL] = 'MySQL DB';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_PGSQL] = 'PgSQL DB';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_CVS] = 'CVS Repository';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_SVN] = 'SVN Repository';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_DNS] = 'Domain Name';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_MAIL] = 'Mail Domain';
-$TYPES_STRINGS[Vhffs::Constants::TYPE_ML] = 'Mailing List';
+$TYPES_STRINGS[Vhffs::Constants::TYPE_USER] = gettext_noop('User');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_GROUP] = gettext_noop('Group');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_HTTPD] = gettext_noop('Webarea');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_REPOSITORY] = gettext_noop('Download Repository');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_MYSQL] = gettext_noop('MySQL DB');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_PGSQL] = gettext_noop('PgSQL DB');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_CVS] = gettext_noop('CVS Repository');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_SVN] = gettext_noop('SVN Repository');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_DNS] = gettext_noop('Domain Name');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_MAIL] = gettext('Mail Domain');
+$TYPES_STRINGS[Vhffs::Constants::TYPE_ML] = gettext_noop('Mailing List');
 
 sub hash_mxdomain
 {


Property changes on: trunk/vhffs-compat
___________________________________________________________________
Name: svn:ignore
   - 4.0.sql

   + 4.0.sql
Makefile.in
Makefile



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/