pvbrowser manual
Back Content Forward

Language Translation

pvbrowser menu text can be set to different languages using the INI file "~/.pvbrz". If you want to use non latin character sets like chinese or arabic set "codec=utf8 ## Unicode, 8-bit" in the INI file. Then you can use these characters in the INI file and in your sourcecode.

In order to use UTF-8 on Linux you have to define it in your ~/.bashrc or your system profile.

Example:

export LC_ALL=de_DE.utf8
export LANG=de_DE.utf8
export LANGUAGE=de_DE.utf8

You can find out the installed locales with the following command:

locale -a

In order to use UTF-8 for development under Windows you need Visual Studio .Net . There you have to include and set the locale.

<locale.h>
...
setlocale(LC_ALL,"de_DE.utf8"); 

Currently this is not implemented and tested, because we only have MSDEV 6.0 . But use with a pvserver under Linux is already possible from Window.

While pvbrowser is running you can switch from one language to the other, provided you have programmed this in your pvserver. There is a "#define DEFAULT_LANGUAGE 0" in processviewserver.h. Now you can define (in pvapp.h):

#define GERMAN_LANGUAGE  DEFAULT_LANGUAGE+1
#define FRENCH_LANGUAGE  DEFAULT_LANGUAGE+2
#define SPANISH_LANGUAGE DEFAULT_LANGUAGE+3
#define ITALIAN_LANGUAGE DEFAULT_LANGUAGE+4
#define CHINESE_LANGUAGE DEFAULT_LANGUAGE+5
...

Now set the language parameter of "PARAM *p to your language (Let the user choose his language). "

p->language = GERMAN_LANGUAGE; // the default is: p->language = DEFAULT_LANGUAGE;

Within "slotInit" overwrite all text of any Objects to the other language."

static int slotInit(PARAM *p, DATA *d)
{
  if(p == NULL || d == NULL) return -1;
  switch(p->language)
  {
    case GERMAN_LANGUAGE:
      pvPrintf(p,idOfAnObject,"%s","Dies ist der deutsche Text");
      break;
    case FRENCH_LANGUAGE:
      break;
    case SPANISH_LANGUAGE:
      break;
    case ITALIAN_LANGUAGE:
      break;
    case CHINESE_LANGUAGE:
      break;
    default:
      // nothing todo, because generated_defineMask has already set the text
      break;
  }
  return 0;
}

Back Content Forward