Commit Graph

61 Commits

Author SHA1 Message Date
Georg Baum
960bcc71c1 Get rid of pseudo diffs when remerging strings
cmake sorts the input files for lyx_pot.py internally, but autotools use a
shell pattern like *.ui on the command line, so the order may be different
on different machines. It is more robust not to require any sorting from the
caller, so lyx_pot.py sorts now internally.
2016-06-04 17:33:19 +02:00
Georg Baum
ba6d84c917 Always use unix line ends in .pot files
Otherwise gettext creates files with stray '\r' in comment lines on windows.
2016-05-29 17:55:44 -04:00
Georg Baum
262ae8264a Make lyx_pot.py python3 compatible
Now it produces the same output if running under python3 (tested with 3.4.2)
or python2 (tested with 2.7.9). python3 always uses unicode strings
internally, so we have to specify the file encoding on opening a file, such
that strings can be converted from and to the file encoding on reading and
writing. Using the io module for file io ensures that the behaviour is the
same for python2 and python3. For python2 we also have to mark string literals
as unicode strings by using the u prefix (which is a noop in python3).

Many thanks to José for review and pointing out all the details.
2016-03-25 10:24:46 +01:00
Guillaume Munch
3c9b62a69d Layout format update: AddToToc, IsTocCaption, OutlinerName
Preliminary work for addressing #7790. Thanks to Richard for providing initial
files this is based on.

Adding to TextClass:
    OutlinerName <string> <string>
    (the second string is translated)
e.g.:
    OutlinerName thm "Definitions & Theorems"

Adding to Layout:
    AddToToc <string>     (default "", means no)
    IsTocCaption <bool>   (default 0)
e.g.:
    AddToToc thm
    IsTocCaption 1

Adding to InsetLayout:
    AddToToc <string>     (default "", means no)
    IsTocCaption <bool>   (default 0)
e.g.:
    AddToToc literate

Adding to inset arguments:
    IsTocCaption <bool>   (default 0)
2015-12-13 19:56:49 +00:00
José Matos
0a03528376 First step to make po python files to support both python 2 and python 3 (3.3+)
Most of the changes are related with dictionaries returning iterators instead of
    lists. (Iterators and not views as I wrote in the previous commit message)

    xrange -> range (since xrange is gone in python 3)
2015-03-11 13:41:10 +00:00
Kornel Benko
29b5934ac7 Corrected tooltip search string.
This worked wrong in case where the text contained the string 'tooltip' too.
2014-07-03 13:52:52 +02:00
Juergen Spitzmueller
5e530e0757 lyx_pot.py: Do not strip blanks in HelpText.
This fixes a thinko introduced in [c5ef7cfc/lyxgit]

Fixes: #9054.
2014-04-22 10:36:09 +02:00
Georg Baum
ba8c5bb511 Remove context also for translated strings
This is consistent with the treatment in LyX itself (cleanTranslation() is
also called on the translated strings), and some translators leave the context
in the translated msgstr (e.g. [[List of Listings]]), although that is not
recommended. Without this, lib/layouttranslations would contain wrong
translations.
2014-03-06 22:00:12 +01:00
Georg Baum
474e42923b Fix logic error in layout translation extraction
lyx_pot.py treats the combination IsPredefined == true and UsesFloatPkg == true
incorrectly: In this case it does not extract the float name, although it needs
to be extracted. This was no problem for LyX 2.0.0, because no layout contained
this combination fo flags. However, the current version of achemso.layout uses
it for several styles, e.g. "List of Schemes".
You only see the bug if you remove lib/layouttranslations before updating it,
otherwise it would be covered by the old translations which are kept. The fix
make use of the fact that IsPredefined == false and UsesFloatPkg == false is
not supported by LyX to simplify the logic.
2014-03-06 21:42:51 +01:00
Kornel Benko
572c81e185 Handle also the parameter "variableunsafe" in lib/encodings to retrieve a translatable string. 2013-01-31 11:54:32 +01:00
Juergen Spitzmueller
ee95471dd9 fix caption layout detection 2012-12-31 15:30:32 +01:00
Juergen Spitzmueller
c246076ed5 Fix the 'caption inset mess' (bug #4647) 2012-12-30 18:29:02 +01:00
Kornel Benko
c5ef7cfcc4 Do not insert trailing blaks to translatable string
while generating .pot files.
2012-12-20 15:02:01 +01:00
Juergen Spitzmueller
25ef8e7eef Allow to separate menu string from label string for arguments 2012-12-09 19:15:41 +01:00
Juergen Spitzmueller
29d48665fa i18n for argument strings 2012-11-23 14:50:52 +01:00
Juergen Spitzmueller
195df5765f Make textclass categories and descriptions translatable 2012-10-09 07:25:35 +02:00
Juergen Spitzmueller
869b84aef9 Clean up LaTeX font handling (#4999)
The LaTeX font information are now centralized and outsourced. This removes a lot of hardcoding and duplication and makes it easier to support new LaTeX fonts.
2012-08-16 13:23:39 +02:00
Georg Baum
a2e8cb758b Translations for listings insets
The listings inset and include inset of type listings use two english terms
that are not localized yet: "Listing" for the caption and "Listings" for the
list of listings (not supported natively by LyX yet). The existing layout
translation mechanism has been extended to translate these terms as well:

1) Support [[stuff]] context in lib/layouttranslations
2) Support BabelPreamble and LangPreamble in InsetLayout
3) Use a InsetLayout for InsetInclude of type listings
4) Define BabelPreamble and LangPreamble in the layouts for InsetInclude
   and InsetListings
2012-04-10 20:21:01 +02:00
Georg Baum
2b58df827b Make .po string extraction more robust:
- Do not parse case insensitive tags case sensitive
- Reintroduce missing translations that were accidentally lost with the
  introduction of the I18nPreamble and EndI18nPreamble tags


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38584 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-04 18:21:15 +00:00
Georg Baum
910a517f69 Remove unneeded layout translations as hinted on the users list.
The standard babel names are used instead of these translations.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38296 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-06 20:57:46 +00:00
Pavel Sanda
8fc7939eb8 * lyx_pot.py
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38284 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-06 11:15:53 +00:00
Georg Baum
e396d2a032 Warn if old file is not found
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38164 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-30 18:21:52 +00:00
Georg Baum
cc06353ebc Kepp all keys in lib/layouttranslations to ease translation work
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38163 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-30 17:39:38 +00:00
Pavel Sanda
ec7f123948 Add comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38125 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-29 11:33:02 +00:00
Georg Baum
b6262f5865 1) Keep manual translations in lib/layouttranslations
2) Fix ia translations (for some reason it was a copy of it)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38031 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-24 21:21:12 +00:00
Georg Baum
55ef7b50b5 First version of separate translation machinery for strings that go into
exported documents.
To update the translations from the .po files, run
make ../lib/layouttranslations
from po.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38016 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-23 19:17:15 +00:00
Georg Baum
013b2c5be0 small preparation for the layout translation fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37985 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-21 19:11:53 +00:00
Enrico Forestieri
b5c25fe3b2 When collecting strings from ui-files, transform the html entity '&quot;'
to '"' for the sake of gettext tools, which are html-agnostic.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37029 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-29 02:00:27 +00:00
Enrico Forestieri
432e32cd3a lyx_pot.py cannot deal with raw newlines in ui files. So, use the
html entity "&#x0a;" and then transform it to "\n".


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37026 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-28 23:29:51 +00:00
Pavel Sanda
7e2d396770 Kill Flex:constructs in po files.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg163696.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36461 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-24 23:53:41 +00:00
Jürgen Spitzmüller
148f2d648c The languages file rewrite.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36285 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-13 17:25:03 +00:00
Richard Heck
d4634167cc Get rid of "CharStyle:", "Custom:", and "Element:" prefixes, per a
suggestion of JMarc's. Docs to follow.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35608 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-12 14:46:17 +00:00
Richard Heck
808ff6650c Introduce a simple macro facility for citation formats. Also introduce
simple, translatable units for use in such formats.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33924 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-29 20:01:28 +00:00
Kornel Benko
0f3c445dd4 Extracting also strings containing dash from languages-file
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33334 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-05 14:49:58 +00:00
Richard Heck
498478a2bd Ignore quotes in lyx_pot.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33117 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 20:52:03 +00:00
Richard Heck
c2ac70552c Introduce a "formatted counter" for use with formatted reference during
XHTML output.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33113 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 20:33:36 +00:00
Jürgen Spitzmüller
d103ab6cf9 * lyx_pot.py:
- make IconPalette tooltips translatable.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32026 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 17:27:21 +00:00
Richard Heck
05e00b9341 Translate categories.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31035 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-14 15:35:05 +00:00
Kornel Benko
aea6be38bb Added new parameter, to handle otherwise owerflow
of the windows command line length.

Patch by José Abílio Matos.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29640 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-12 09:19:13 +00:00
Georg Baum
9aad4bc27f Better fix for bug 1476 (following an idea by Jean-Marc).
Don't go into an endless loop if layout2layout cannot produce the desired file format.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28529 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-17 20:25:56 +00:00
Uwe Stöhr
10d742cfe3 - de.po: translation updates for trunk
- po-files: remerged

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28307 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-01 18:32:38 +00:00
Jürgen Spitzmüller
0e1f67f8ea * lyx_pot.py:
- allow comma in language name (bug 5459).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27300 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-05 23:44:40 +00:00
Jürgen Spitzmüller
dcc4d58b66 *** Implement GUI names for encodings (part of bug 4971) ***
* lib/encodings:
	- add new column "GUI names"

* src/Encoding.{cpp,h}:
	- read in and handle GUI names

* src/frontends/qt4/GuiDocument.cpp:
	- display GUI names instead of LaTeX names

* po/lyx_pot.py:
* po/Rules-lyx:
* development/scons/SConstruct:
	- add encoding GUI names to the po files.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25558 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-11 08:56:17 +00:00
Jürgen Spitzmüller
93ab5a427d * src/frontends/qt4/Menus.cpp:
* po/lyx_pot.py:
	- make flex insets in the menus translatable.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25276 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-16 15:19:31 +00:00
Jürgen Spitzmüller
21bd7671ec *** fix bug 2488 (make dynamic formats in menus translatable) ***
* po/lyx_pot.py:
	- new method formats_l10n that parses configure.py for file formats and shortcuts
* po/Makefile.in.in:
* development/scons/SConstruct:
	- call formats_l10n on po update

* src/frontends/qt4/Menus.cpp:
	- handle translated formats

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24833 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-19 09:33:53 +00:00
Jürgen Spitzmüller
63f67b0116 * po/lyx_pot.py (qt4_l10n):
- escape backslashes in ui strings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24599 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-04 08:55:05 +00:00
Jürgen Spitzmüller
ff0e3cd8b2 * fix translation of module descriptions that have a backslash (bug 4799).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24517 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-27 09:27:50 +00:00
José Matox
72b1ddc3af Update translations for 1.6.0 (alpha 2)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24264 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-15 14:49:37 +00:00
Jürgen Spitzmüller
7c5f52bc20 * po/lyx_pot.py:
- flag Category names for translation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24231 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-11 10:39:00 +00:00
Bo Peng
2ba95426cc change indentation from 2 to 4 in lyx_pot.py
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22582 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-15 04:13:14 +00:00