Frequently Asked Questions - Localization / Internationalization

This category concerns everything related to localized use of LedgerSMB: including regulatory compliance, localized date and number formats as well as translations.

The short answer is that TeX doesn't know how to deal with UTF-8 (or rather non-ASCII) characters. XeTeX has been designed to work around these limitations. The easiest way to generate PDFs is to install Xe(La)TeX and use the 'xedemo' templates - these templates have been 'ported' from LaTeX to XeLaTeX.

Distribution specific install instructions listed below.

Debian / Ubuntu 

Install texlive-xetex that includes xelatex

apt-get install texlive-xetex

but you need to patch LaTeX::Driver
Install liblatex-{driver,encode,table}-perl for latex

apt-get install liblatex-{driver,encode,table}-perl

and libmoosex-followpbp-perl for Template::Plugin::Latex

apt-get install libmoosex-followpbp-perlafter that:

apt-get install libtemplate-plugin-latex-perl  (or cpan Template::Plugin::Latex)
 

LedgerSMB xelatex configuration

Install xelatex and change the LedgerSMB configuration from the menu:
System -> System Defaults -> Templates directory
Change to "xedemo"

Change a path

From the mailing list: (Chris Travers)
Right now, I am open to suggestions on a better approach, as the Template::Latex api's don't seem to work to do this, but I resorted to changing the paths in LaTeX::Driver::Paths directly (find the location with locate LaTeX/Driver/Paths.pm). This file gets written at installation time for the LaTeX::Driver module and so I consider it reasonably editable.

locate LaTeX/Driver/Paths.pm

If locate is not installed you can do:  find /usr . |grep "LaTeX/Driver/Paths.pm"
/usr/share/perl5/LaTeX/Driver/Paths.pm  ( Debian / Ubuntu )

Make a backup copy of  LaTeX/Driver/Paths.pm (you have to have root priviliges to do this or use sudo)

cp /usr/share/perl5/LaTeX/Driver/Paths.pm /usr/share/perl5/LaTeX/Driver/Paths.pm.backup(Change the path to your path for LaTeX/Driver/Paths.pm)

User your text editor to edit LaTeX/Driver/Paths.pm  (you have to have root priviliges to do this or use sudo)

In LaTeX/Driver/Paths.pm change

$program_path{pdflatex} = '/path/to/pdflatex;

to

$program_path{pdflatex} = '/path/to/xelatex';

 

This is the error you get, if you do not change:
/usr/share/perl5/LaTeX/Driver/Paths.pm  (Debian path)  :


Error!

latex error - pdflatex exited with errors:
!
l.26 \RequireXeTeX
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX to function.
!
! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
! instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.38 }



 

The utf8 character "hack fix"

Before making this change will UTF8 characters appear as squares in the PDF file. To print utf8 characters in pdf files, you must make the following change:

These are the steps:
su root
open /usr/share/perl5/LaTeX/Driver.pm
in your text editor
go to line 174 on Debian Squeeze (6.x) and line 176 on Debian Wheexy (7.x)
you see "write_file( ..." there
change

".tex", $source

to

".tex", {binmode=>':utf8'}, $source

 

Font fix

In order for Verdana to work, install the package ttf-mscorefonts-installer (Debian/Ubuntu)

apt-get install ttf-mscorefonts-installer

In versions 1.3.28 and up, the demo templates no longer depend on Verdana though, but use the non-proprietary Liberation font set, which can be installed using

apt-get install fonts-liberation
 

Code reference to LedgerSMB

The code for this is LedgerSMB/Template/Latex.pm

Component: 
Base
Release: 

The templates use the Template Toolkit scripting language to generate actual content.
Depending on the typesetting language, the files use
* HTML;
* (Xe)LaTeX; or
* plain text
as the typesetting system.

While LaTeX and XeLaTeX are extremely similar, some differences exist, mainly in the area of font selection and document preamble.


Latex cheat sheet - http://www.stdout.org/~winston/latex/

Latex in 157 minutes - http://tobi.oetiker.ch/lshort/lshort.pdf



The LATEX Font Catalogue - http://www.tug.dk/FontCatalogue/about.html

Guide in Norwegian: http://dag.at.ifi.uio.no/latex-links/uiofonts.pdf

Component: 
Base
Release: 

My problem is that I want to translate LedgerSMB to Spanish Venezuela, I know that already it is, but there are still some words that are not. So I'm trying to add them.

 

There's a section dedicated to translation. That should help you to get started.
 
The basic idea is that everything you can learn from the web about translating with gettext applies to LedgerSMB's gettext translation as well, with the note that you should be able to find a recent POT file in the repository next to the source code for the latest development version (trunk) and the latest stable release (1.3).
Release: 

We don't know enough about the ideosyncracies with your laws to evaluate that. But quite frankly Free Software sometimes poses an issue with local regulation. If you go with LedgerSMB, I'd recommend working with us to detail any shortcomings and get those resolved.

You can help us to make a list over "X country" laws and LedgerSMB shortcomings according your countrys law.

Release: