From: Dave K. <dku...@da...> - 2017-05-04 23:41:46
|
Matěj, I've started work on this. There are several things I need to learn, but, so far, it looks do-able. In the meantime, here is something you might want to try -- rst2odt.py uses a "stylesheet". I put that in quotes because it's not actually a sheet (which I think of as text). Rather, it's a LibreOffice Writer document. The default is included with the Docutils distribution and is called 'styles.odt'. So, here is what you can do: 1. Find the default 'styles.odt', and make a copy (if you have not already done so). 2. Open it in LibreOffice Writer, change the default language, in your case Czech, and save it (or save it under a new name). 3. Then convert your reST text document to a ODT document using your custom stylesheet with something like the following:: $ rst2odt.py --stylesheet=my_cs_style.odt indoc.txt outdoc.odt When I did the above, and then opened that output .odt file in LibreOffice Writer, the default language was set to Czech, if I understand you correctly. Does that work for you? If so, does it do what you want it to? And, if so, maybe this is even the preferred way to do it. What do you think? Either way, I'll work on the -l/--language command line option. I think we want that feature. Dave K On Thu, May 04, 2017 at 11:15:42AM +0200, Matěj Cepl wrote: > On Wed, 2017-05-03 at 16:58 -0700, Dave Kuhlman wrote: > > Yes. That was helpful. I'm wondering if you will expect other > > kinds of styles to be changed also. For example, under the > > "Tools" menu there are "Language" settings. > > That’s just direct formatting forcing itself over the styles. > Don’t touch it. > > > And, in the "Styles and Formating" window their are also > > character styles (when you click on the character icon). The > > test I made does seem the change those also, which I guessing > > you want to happen. > > I believe character styles cover just changes over the underlying > paragraph style, so these follow "Default Style" as well (or > not, it seems that for example "Internet Link" has language set > to "None", which is sensible). At least I see here, that the > footnote reference is in Czech, when I create a footnote, which > is what I want. > > In short, I believe that changing "Default Style" (or whatever is > its name in other locale, but I guess inside the ODT file itself > the displayed name does not matter, does it?) is enough for now. > We may discover later that we have created something wrong, but > we will deal with it then, I guess. > > I have asked my colleague (I work for Red Hat) about this and his > conclusion was it should be enough to set language for > style:default-style style:family="paragraph" and style:default- > style style:family="graphic" into a fresh styles.xml. > > > You've given me enough to start work with. Thanks. I'll > > report back when I've made a little progress and hopefully have > > something you can test. > > BTW, I did not tell you how much I am grateful for having so well > working rst2odt script as we have. Thank you! > > Matěj > > -- > http://matej.ceplovi.cz/blog/, Jabber: mcepl<at>ceplovi.cz > GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 > > Blessed be the God […] who comforts us in all our affliction, so > that we may be able to comfort those who are in any affliction, > with the comfort with which we ourselves are comforted by God. > -- 2. Corinthians 1:3-4 > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Docutils-users mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > > Please use "Reply All" to reply to the list. -- Dave Kuhlman http://www.davekuhlman.org |