Logo Search packages:      
Sourcecode: netams version File versions  Download package

lang.c

/*************************************************************************
***   Authentication, authorization, accounting + firewalling package
***   Copyright 1998-2002 Anton Vinokurov <anton@netams.com>
***   Copyright 2002-2008 NeTAMS Development Team
***   This code is GPL v3
***   For latest version and more info, visit this project web page
***   located at http://www.netams.com
***
*************************************************************************/
/* $Id: lang.c,v 1.12 2009-08-01 09:23:55 anton Exp $ */

#include "netams.h"
//////////////////////////////////////////////////////////////////////////////////////////
const char *language_str[LANGUAGES_DEFINED]= { "en", "ru" };
const char *language_charset_str[LANGUAGES_DEFINED]= { "en", "windows-1251" };

//////////////////////////////////////////////////////////////////////////////////////////
int cLang(struct cli_def *cli, const char *cmd, char **argv, int argc){
      if(argc==1) return CLI_ERROR;

      for (u_char i=0; i<LANGUAGES_DEFINED; i++){
            if (STREQ(argv[1], language_str[i])) {
                  lang=(language)i;
                  cli_error(cli, "output language is %s", language_str[i]);
                  if (is_running) gettimeofday(&when_config_changed, NULL);
                  return CLI_OK;
            }
      }
      cli_error(cli, "output language %s unsupported\n", argv[1]);
      return CLI_OK;
}
//////////////////////////////////////////////////////////////////////////////////////////
const char *Locale(unsigned key, int force_english){
      locale_item *i = &locale_data[key];
      
      const char *res;
      if (force_english) res=i->data[LANG_EN]; 
      else res=i->data[lang];
      
      if (res) return res; else {
            aLog(D_WARN, "Localization problem, lang=%s, key=%u\n", language_str[lang], key);
            return "<\?\?\?>";
      }
}
//////////////////////////////////////////////////////////////////////////////////////////
locale_item locale_data[] = {
      { LC_H_TRAFINFO, {
            "Traffic information from %02d.%02d.%04d %02d:00 to %02d.%02d.%04d %02d:00", 
            "Информация о трафике с %02d.%02d.%04d %02d:00 по %02d.%02d.%04d %02d:00" }, },
      { LC_H_RUNTIME, { 
            "Runtime information page", 
            "Информация о работе программы" }, },
      { LC_H_TIMEDERIVED, { 
            "Time period-derived statistics for", 
            "Статистика для различных интервалов времени, за" }, },
      { LC_H_OBJSTAT, { 
            "Objects statistics", 
            "Статистика по объектам" }, },
      { LC_H_GROUPS, { 
            "Groups", 
            "Группы" }, },
      { LC_H_UNITS, { 
            "Units", 
            "Юниты" }, },
      { LC_H_SYSTAT, { 
            "System status", 
            "Статус системы" }, },
      { LC_H_SYSTAT_LOAD, { 
            "Current system load", 
            "Текущая загрузка системы" }, },
      { LC_H_SYSTAT_HTML_ST, { 
            "HTML files folder free disk space", 
            "свободного места на разделе, где создаются HTML-страницы" }, },
      { LC_H_SYSTAT_PRI_ST, { 
            "primary storage folder free disk space", 
            "свободного места на разделе, где хранится база данных" }, },
      { LC_H_SYSTAT_WRONG, { 
            "WARNING! Your system is in wrong state!", 
            "ВНИМАНИЕ! Ваша система находится в опасном состоянии!" }, },
      { LC_H_TOPUSERS, { 
            "Top network users", 
            "Наиболее активные пользователи сети" }, },
      { LC_H_TOPUSERS_STR, { 
            "top users for this <A href=\"top.html\">hour</a>, <A href=\"../top.html\">day</a>, <A href=\"../top-week.html\">week</a> and <A href=\"../../top.html\">month</a>", 
            "наиболее активных пользователей за этот <A href=\"top.html\">час</a>, <A href=\"../top.html\">день</a>, <A href=\"../top-week.html\">неделю</a> и <A href=\"../../top.html\">месяц</a>" }, },
      { LC_H_SERVICES, { 
            "Status of services", 
            "Статус работы сервисов" }, },
      { LC_H_SERV_OUTPUTOF, { 
            "Output of", 
            "Вывод команды" }, },
      { LC_H_SERV_STATE, { 
            "State of", 
            "Состояние" }, },
      { LC_H_SERV_QUOTA, { 
            "quota service", 
            "сервиса квот" }, },
      { LC_H_SERV_LOGIN, { 
            "login service", 
            "сервиса логинов" }, },
      { LC_H_SERV_BILLING, { 
            "billing service", 
            "сервиса биллинга" }, },
      { LC_H_SW_VERSION, { 
            "Software version", 
            "Версия программы" }, },
      { LC_H_REPORT, { 
            "This is the automatic report built by", 
            "Автоматически сформированный отчет" }, },
      { LC_H_CR_TIME, { 
            "Time of creation", 
            "Время создания" }, },
      { LC_H_BACK, { 
            "back", 
            "назад" }, },
      { LC_H_THIS_MONTH, { 
            "This month", 
            "Этот месяц" }, },
      { LC_H_THIS_DAY, { 
            "This day", 
            "Этот день" }, },
      { LC_H_RUNNING_CONFIG, { 
            "Running config", 
            "Текущая конфигурация" }, },
      { LC_H_CURRENT, { 
            "for current", 
            "на текущий" }, },
      { LC_H_CURRENT2, { 
            "for current", 
            "на текущую" }, },
      { LC_H_CHOUR, { 
            "HOUR", 
            "ЧАС" }, },
      { LC_H_CDAY, { 
            "DAY", 
            "ДЕНЬ" }, },
      { LC_H_CWEEK, { 
            "WEEK", 
            "НЕДЕЛЯ" }, },
      { LC_H_CWEEK2, { 
            "WEEK", 
            "НЕДЕЛЮ" }, },
      { LC_H_CMONTH, { 
            "MONTH", 
            "МЕСЯЦ" }, },
      { LC_H_INDEX_MONTH, { 
            "Index pages for month", 
            "Страницы за месяц" }, },
      { LC_H_TRAFINFO_SELECTED, { 
            "Traffic information for selected unit", 
            "Информация о трафике для выбранного юнита" }, },
      { LC_H_CALENDAR, {
            "Calendar", 
            "Календарь" }, },
      { LC_H_TRAFINFO_FOR, {
            "Traffic statistics for", 
            "Статистика по трафику для" }, },
      { LC_H_TRAFINFO_ACTUAL, {
            "actual for creation time ONLY!", 
            "актуально только для времени создания!" }, },
      { LC_H_ALL_ZERO, {
            "all counter values are zero", 
            "все значения счетчиков равны нулю" }, },
      { LC_H_ACCT_POLICY, {
            "accounting policy", 
            "политика учета" }, },
      { LC_H_IN, {
            " in", 
            "получено" }, },
      { LC_H_OUT, {
            "out", 
            "отправлено" }, },
      { LC_H_TYPE, {
            "TYPE", 
            "ТИП" }, },
      { LC_H_NAME, {
            "NAME", 
            "ИМЯ" }, },
      { LC_H_DESCR, {
            "DESCRIPTION", 
            "ОПИСАНИЕ" }, },
      { LC_H_IP, {
            "IP", 
            "IP-адрес" }, },
      { LC_H_POLICY, {
            "POLICY", 
            "ПОЛИТИКА" }, },
      { LC_H_PREINCLUDED_LEFT, {
            "Preincluded traffic left for", 
            "Осталось предвключенного трафика для" }, },
      { LC_H_SUBPLAN_ID, {
            "subplan-id", 
            "номер подплана" }, },
      { LC_H_B_ACNAME, {
            "Account name", 
            "Имя аккаунта" }, },
      { LC_H_B_BALANCE, {
            "Balance", 
            "Баланс" }, }, 
      { LC_H_B_STATUS, {
            "Status", 
            "Статус" }, }, 
      { LC_H_B_PLAN, {
            "Plan", 
            "Тарифный план" }, }, 
      { LC_H_B_UNITS, {
            "Units", 
            "Юниты" }, }, 
      { LC_H_B_BLOCKED, {
            "BLOCKED", 
            "БЛОКИРОВАН" }, }, 
      { LC_H_B_BEBLOCKED, {
            "BEBLOCKED", 
            "БУДЕТ БЛОКИРОВАН" }, }, 
      { LC_H_B_UNBLOCKED, {
            "UNBLOCKED", 
            "РАЗБЛОКИРОВАН" }, }, 
      { LC_H_B_BALANCE_FOR, {
            "Balance for selected account", 
            "" }, }, 
/*    { , {
            "", 
            "" }, }, 
      { , {
            "", 
            "" }, }, 
      { , {
            "", 
            "" }, }, 
      { , {
            "", 
            "" }, }, 
*/          
};

      


Generated by  Doxygen 1.6.0   Back to index