Commit Graph

80 Commits

Author SHA1 Message Date
Juergen Spitzmueller
e5e4cd6086 lyx_pot.py: Fix regex for \Format
Each token could be delimited by quotation marks or not. The previous
regexes only considered this for two tokens and hence produced wrong
matches for cases such as

\Format gnuplot     "gp, gnuplot, plt"    "Gnuplot"     "" "" ""  "vector"	"text/plain"

where the extension list wasn't parsed as a single token.

(cherry picked from commit 1efdc11296)
2024-08-07 11:37:17 -04:00
Scott Kostyshak
9c16e25a84 Fix Python warning of invalid escape in lyx_pot.py
Newer Python versions (e.g., Python 3.12.3) gave the following
warning:

  po/lyx_pot.py:607: SyntaxWarning: invalid escape sequence '\w'

An alternative fix would be to double the backslash, but that might
be less readable than this fix.

(cherry picked from commit 325f1429f8)
2024-06-08 13:49:41 -04:00
Juergen Spitzmueller
471fb72f02 Translate B_ strings in citeengines 2023-02-21 08:25:44 +01:00
Juergen Spitzmueller
cfc3b3675b Account for Windows paths (#11975) 2020-09-17 07:17:36 +02:00
Jean-Marc Lasgouttes
c293be56bd Rename frontend qt4 to qt
In particular, the directory frontends/qt4 is renamed to frontends/qt.

Many configurations file have to be updated. All mentions of qt4 in
the source have been audited, and changed to qt if necessary.

The only part that has not been updated is the CMake build system.
2019-07-20 23:39:40 +02:00
Kornel Benko
131f1b6a9c Handle some extra characters used in names for encodings
Without this some encoding-names would not be translated.
The extra used chars are '[', ']' and '/'
like in lib/encodings:55
        Encoding utf8x utf8x "utf8 (extended) [ucs] (utf8x)" UTF-8 variable inputenc
2019-06-09 15:17:23 +02:00
Juergen Spitzmueller
683b3a05e2 Introducing table templates
The idea is simple: we insert a pre-formatted table (with a given border
style currently, but other attributes are possible as well) via file-insert
and scale it then to the requested size.

We need three sizes (1x1, 1x2 and 1x3) to generate all sizes properly (due
to border specifications).

Currently, these styles can only be accessed via lfun tabular-style-insert
and the Tabular Create dialog.

My plan is to add a buffer param to set a default style (#9901) which then
also is respected by the toolbar button and probably a layout tag to let
classes specify a default style (#8360).
2019-03-26 13:43:33 +01:00
Juergen Spitzmueller
ca024383e0 Fix problematic characters in example/template file names
For (, ) and & we use URL encoding now.
2019-03-22 11:10:49 +01:00
Juergen Spitzmueller
c8930f6342 Add examples/templates dialog entries to po files. 2019-03-19 09:08:44 +01:00
José Matos
3f03f0a447 Move all python shebangs from /usr/bin/env to python3.
The change is only relevant to development as all the call to python scripts is done
calling C++ os::python that invoques the appropriate python version.

The change is two fold, on one hand remove all the uses of /usr/bin/env for python.

On the other hand rename all the calls to python from python to python3 making it explicit
and being compliant with PEP 394 -- The "python" Command on Unix-Like Systems:
https://www.python.org/dev/peps/pep-0394/

Remove the sheebang from src/graphics/GraphicsConverter.cpp because it is not necessary.

Some small whitespace changes.
2018-12-29 19:14:41 +00:00
Kornel Benko
a7c1d955c2 Add missing handling of entry 'Dynamicmenu' to po/lyx_pot.py 2018-05-07 13:43:48 +02:00
Juergen Spitzmueller
43c05fe16b lyx_pot.py: consider empty encoding gui name 2018-01-02 13:55:01 +01:00
Kornel Benko
3ea8f0f81b Amend 268ae66: Enable use of '\\' chars and empty lines in HelpText 2017-06-08 17:57:32 +02:00
Juergen Spitzmueller
52019917f4 Split external_templates to individual *.xtemplate files
This makes it easier to add new templates or change existing ones
in the user directory.

Fixes: #3983

The CMake changes should be double-checked.
2017-03-26 15:32:01 +02:00
Guillaume Munch
05b90abaf7 Allow more translations of OutlinerNames
Allow comments at the end.

Although comments seem to be valid at the end of lines in layouts, few of the
regexps take this into account. However, OutlinerName was the only one where
there were actual lines with comments at the end. Not touching the others as
there is no one-size-fits-all solution with these regexps.

Thanks Kornel for reporting the issue.
2017-02-21 21:04:50 +01:00
Juergen Spitzmueller
ac064cf0f4 Fix the fix of description parsing 2017-02-16 10:28:11 +01:00
Juergen Spitzmueller
06f933bc89 Fix Description parsing 2017-01-14 18:11:39 +01:00
Juergen Spitzmueller
bb04dcdd26 l7n 2017-01-09 09:50:34 +01:00
Juergen Spitzmueller
97aea7e5b1 Disentangle CiteEngines and Modules
These two are different beasts and thus should be handled differently.
2017-01-01 07:56:24 +01:00
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