New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup multiline translatable strings, adds one paragraph tweak #4524

Merged
merged 3 commits into from Jan 28, 2019

Conversation

Projects
None yet
2 participants
@poire-z
Copy link
Contributor

poire-z commented Jan 28, 2019

Thanks to koreader/koreader-misc#24, revert #4132

Adds "Generic web browser paragraph style" style tweak:

info_text = _([[
An alternative table of content can be built with a long-press on the "Table of content" menu item.
info_text = _(
[[An alternative table of content can be built with a long-press on the "Table of content" menu item.

This comment has been minimized.

@Frenzie

Frenzie Jan 28, 2019

Member
Suggested change Beta
[[An alternative table of content can be built with a long-press on the "Table of content" menu item.
An alternative table of contents can be built with a long-press on the "Table of contents" menu item.
@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 28, 2019

Like I said in the issue, I think this basically makes the code a little uglier, but that's just personal preference.

{
id = "paragraph_web_browser_style";
title = _("Generic web browser paragraph style"),
description = _("Display paragraphs as web browsers do, discarding KOReader's book paragraph style.\nThis might be needed with some documents that expect this style as the default, and only use CSS when it needs to diverge from this default."),

This comment has been minimized.

@Frenzie

Frenzie Jan 28, 2019

Member

I'm not sure if "as web browsers do" is very clear. I'd just call it something like full-block style paragraphs vs indented paragraphs.

This comment has been minimized.

@poire-z

poire-z Jan 28, 2019

Author Contributor

That's not just that: it's margin top and bottom (I saw that some publishers use margin-bottom: -1em to revert that... instead of using a simpler margin-top: 0 margin-bottom: 0), no text justification (so, text-align: left), no text-indent ... Just as we are used to see <P> in all web browsers :)
And setting this combo make some publisher styles just display nice.

This comment has been minimized.

@Frenzie

Frenzie Jan 28, 2019

Member

What do you mean by also margin top and bottom? I meant,

Full-block style (block-style is standard English for this concept)

I am a paragraph in a modern American business letter.

I am another paragraph. I'm not indented and there's whitespace
in between me and my predecessor.

Indented

I probably require no explanation,
but I am a paragraph
in a traditional Dutch letter.
    I, as a second paragraph, am indented.

Knowing what browsers do if you just give them some plain HTML without custom styling is more specialized knowledge, I'd say.

But it might work by just mixing the explanation in there a bit? Display paragraphs as browsers do, in full-block style without indentation or justification, discarding…

This comment has been minimized.

@poire-z

poire-z Jan 28, 2019

Author Contributor

it might work by just mixing the explanation in there a bit

Indeed, that will do.

@poire-z

This comment has been minimized.

Copy link
Contributor Author

poire-z commented Jan 28, 2019

I somehow agree :)
I don't mind going thru them all and others (starting with ^[[ : 22 in frontend/, 10 in plugins/) to make them look like we both prefer. Should I?

@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 28, 2019

Sure, why not? Most of them were changed to be that way in the first place because I was too tired or didn't have/take enough time to properly think about the problem a few months ago. ;-)

@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 28, 2019

As an aside, in Dutch widows and orphans are whore's children and orphans. I had to look that up for the translation. (As if widows and orphans weren't bad enough…)

poire-z added some commits Jan 28, 2019

[chore] cleanup multi-lines translatable strings
Revert 9971eb8 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)

@poire-z poire-z force-pushed the poire-z:fix_untranslatable2 branch from 62be48f to f71d8de Jan 28, 2019

@poire-z poire-z changed the title Fix untranslatable strings, adds one paragraph tweak Cleanup multiline translatable strings, adds one paragraph tweak Jan 28, 2019

@Frenzie
Copy link
Member

Frenzie left a comment

lgtm

@poire-z poire-z merged commit b121581 into koreader:master Jan 28, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@poire-z poire-z deleted the poire-z:fix_untranslatable2 branch Jan 28, 2019

Frenzie added a commit to Frenzie/koreader that referenced this pull request Jan 30, 2019

[chore, CI] Ensure no whitespace between gettext() call and string
Follow-up to koreader#4524

The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.

```
_(
[[
```

It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.

Frenzie added a commit to Frenzie/koreader that referenced this pull request Jan 30, 2019

[chore, CI] Ensure no whitespace between gettext() call and string
Follow-up to koreader#4524

The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.

```
_(
[[
```

It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.

Frenzie added a commit that referenced this pull request Jan 31, 2019

[chore, CI] Ensure no whitespace between gettext() call and string (#…
…4530)

Follow-up to #4524

The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.

```
_(
[[
```

It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment