-
Notifications
You must be signed in to change notification settings - Fork 0
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
Translation into other languages #4
Comments
I will translate it into Romanian. Let's include as many as we can. I noticed that only the beginning quotes used in the German language are identical with the ones used in Romanian, so maybe we could let the user choose the beginning and end quotes. |
My idea in https://github.com/spodermenpls/smartquotes/blob/kkapsner-dev/compose/rules.js is to have different rules which are determined by the UI language and can also be change manually (currently it's only per composer window and not yet a global setting, but we could change that). Maybe a "custom" quote rule there where the user can provide the beginning and end quotes in a setting page can be a good idea. For all the folks that are not German, English or Romanian. |
try to get a free account at crowdin.com - they make it free for open source. The crowdin interface to github makes this sooooo easy. |
Found this - there are very unfamiliar quotation marks... I have never seen the Japanese ones. |
@jobisoft There's no trying needed, I already have one. 😅 I'll set up the project there with its source strings as soon as possible. Choosing between different writing languages and their quotation systems (typographic, guillemots..) isn't the same as localizing the UI texts though, so those should be handled / work independently from each other. |
I was about to fill out the "open-source application form" over there, the conditions however say that one has to have worked on it for at least three months.. with now having barely 1 month of time on this repo (and no publishment on ATN, yet), a request right now may be getting declined, it's probably better to do it the oldschool way (manually / PR) in the time being. |
Why not have the different quote styles per language in the localization files? |
Because one can be native to one language and write in multiple other ones, deviating from the native tongue? |
ah, there could be more/other quote rules included than actual languages prepared for UI. got it. |
@jobisoft: It there an API to get the current dictionary language for the composer window? I think it would be neat to have a mode where the quote rules are automatically changed upon the selected spell checking language. |
You do not have to set up the source strings. The Github interface can do that automatically (that's what I do for CB).
For CB I created a translate.js script that helped with that. I will copy it to this project. |
I also found this site: https://smartquotesforsmartpeople.com/ , implementing support for single openings/closings might be worth consideration too. |
They are already implemented for English. I think they are not used in German... |
The Crowdin open-source license was granted after all. I contacted the support since I still had the "14 day trial" (with deletion of my whole account after that) dangling over my account after creating the project, so I mentioned the insufficent age of the project as the reason of my reluctance to send the request and my decision to delete the whole thing again. The conversationist replied to that with "I guess we can make a little exception in terms [of] 3-months rules 😉". I also put the first "release" together, so it's a bit easier for outsiders to install the extension (which already achieved parity with the original "Smart Quotes"). |
@jobisoft Is there such an API, or not? I'd like to know, too, automatic detection would be nice. @kkapsner Did you implement 'them', or were they already shipped by TB? In German, the typographic variant as |
Currently not, added it to my list |
@kkapsner My question above answered itself after I took a look at the Edit: Damn, I've realized that the 'closing' quotation mark is tilted in the wrong direction, when it's supposed to be used as an apostrophe: https://typefacts.com/artikel/apostroph (described there as an "InDesign-Apostrophe"). Is there somehow a possibility to tell "Smart Quotes" it's supposed to inject the "u2019" symbol, when typing directly after or in between letters? |
Great. That was part of the reason why I made this a separate file: to have an easy to understand way to add new/change rules. I wonder if I should make it less verbose. At the moment the code for the different rules only differs in the Unicode characters that are outputted (I think
Looks fine - as long as the Unicode characters are correct... ;)
Yes there is. It may be a little bit complicated but I think we can define a rule for that. Can you formulate the exact criteria? "typing directly after" is not sufficient as a closing quote has the exact same property. |
It's almost as if you've done stuff like this before. 😄 Determining the best 'minimalist' approach is a bit tricky, with just two languages supported right now. I have the idea to switch from the current "languages in a list" to a language-agnostic "radio buttons" menu, that would ideally consist just of previews of each set's quotation marks in "preview" (since not every language has its own quotation symbols, scrolling through >10 langs is way too much clutter), e.g. like this:
If there's (some day) an automatic detection of dictionary languages, the countries could be tied to the ruleset primarily used in each country, and get automatically set up for the user (e.g. German and Romanian have the first set activated, English the second, French the third).
The two (non-fringe) usecases in German that I view as worth considering are words with a apostrophe in between (" K'lautern ") or at the end, as a possessive indicator for words ending with "s" sounding at the end (" Firefox' " or " Max' "). Described here https://www.duden.de/sprachwissen/rechtschreibregeln/apostroph under chapters D15 and D16. On an independent note, and out of curiosity, how different technically speaking are Firefox text fields and Thunderbird composer windows? 😅 I know both programs share the same codebase (and add-on architecture..), so maybe there's a path one day to go full 360 and cover Firefox as well (as originally requested in the Bugzilla report I linked in the README.MD). Having webmailer, Social Media, platforms like Github, blogs and whatnot with high demand for text input, yet solely browser-based, might profit from this as well, I'd imagine. |
Radio buttons will work until you have around 5 choices I would say. Using Please check my branch for the apostrophe implementation. Thunderbird is an altered Firefox so there is much in common. "Normal" text fields are a little bit different but nothing too complicated. |
@kkapsner Thank you very much for your new commits. I've tested it, and everything seems to work as intended. I think the 'workaround' with the "<>|"-Key is indeed the best solution - using the guillemets like »Word« would be the Austrian and German variant, labeling it as "French" therefore is a kind of half-truth (edit: the French variant is also in use in German-speaking Switzerland), hence my idea of radio buttons and just the symbols as previews, also saving the user of more interactions than just 2 clicks
|
The badge is controlled by Thunderbird code and as far as I know we cannot create such a behaviour. But we have two keyboard shortcuts: Alt+Q (open popup) and Alt+Ctrl+Q (toggle smart quotes). We could also add keyboard control in the popup. For example one could hit Alt+Q to open the popup and then hit Thinking more about it: a shortcut system in the popup would really help. Here are my suggestions:
Theoretical we could make these shortcuts different in different UI languages but that seems wrong to me. |
@kkapsner After my little hiatus, I am back to work on this and I am making progress. I've summarized the Wikipedia "quotation mark" table, and I think with these seven double/single quotation mark variants we're globally covered:
I assume that top-to-down vertical typing (as in some Asian script languages) is not supported by Thunderbird, so I ignored those. There are however some right-to-left typing languages (like Arabic or Hebrew) that should be supported, the compatibility with "Smart Quotes" therefore has to be subject of consideration / testing, in case of technical differences to the usual left-to-right langs. The Wikipedia table entry for Macedonian has a unique 2nd set (German-like, but with both marks located on top), I did however study some Macedonian newspaper websites and didn't see such (real world) usage for words in single quotation marks, so I'd say there is no need to include a dedicated ruleset just for that - otherwise there's still the possibility for two-stepping it by mixing variant 2 and 4, though a bit more burdensome. I took a closer look into the keyboard shortcut idea of yours, Alt+Q indeed opens up the badge menu already, Alt+Ctrl+Q on the other hand just leads to @ symbols being inserted. I think using Alt+(number) (or Alt+A / Alt+T) would be preferable to just pressing (number)-key to switch the rulesets, to avoid conflicts between shortcut-use and number-writing. The Alt-key is ergonomically easy to reach, also in combination with the keys 1-7, so I think adding a third key like "Ctrl" to the mix is unnecessary. In general, I think we should prefer arranging the menu items into width rather than height, so that the overlap stays at the (for writing unneeded) address, subject and attachment fields, rather than the message area. I've assumed that the "automatic menu opening when hover over badge" wouldn't be feasible with TB, however a simple checkbox in the corner, to keep the menu always open, should be, right? As I was looking through the rulesets for all these different languages, I've noticed that there are a lot of apostrophe-like characters, that visually resemble them and are often mistakingly used instead (since even native keyboards don't offer those, often times), even though they're separate, distinct symbols. I haven't determined that list fully yet, however candidates I'd like to include so far are:
To avoid bloating and feature creep, I'd propose to restrict such "extras" to strictly "apostrophe-resembling characters", keeping things like "haček" or "Kahakō" out of scope, turning the extension into sorta "Smart Quotes and Apostrophes" is aready a reality, since German and English apostrophe converting is already part of the package. |
I think the best solution for such an edge case would be to offer a custom ruleset where the user can simply enter four characters to describe their ruleset.
That's what I get for using Linux... you could still use AltGr + Q to get @
The number-keys would only act as a shortcut when the popup is open. You can check it out in the popup-shortcuts branch.
I don't think this is possible.
So your idea is to have two different rules. One for quotes and one for apostrophe? |
The default shortcuts are set now to ALT+T(oggle) and ALT+Q(uotes), as it's optimal for Windows. Are there conflicts with Linux, using this combination? In case it is, is there maybe a possibility to define default presets for different platforms (Windows, macOS, Linux)?
Yes, I got it, my thinking involved the (not possible) possibility of an "always open" SQ popup, in the scenario where the Popup is only opened when one doesn't write, there's obviously no conflict between e.g. typing numbers and selecting presets.
I have thought about this for quite some time and bounced ideas back and forth in my head (also the reason why I didn't answer you back in December right off the bat, since I didn't have a definitive answer yet), how an optimal UI would look like / how all desired features would be optimally wrapped together - which is quite the task, since all major text processing programs deliver "Smart Quotes" converting by default for decades, and there's really no concept to lean on, to my knowledge - however, I think I may have thought up something usable. The six usual templates, as commandeered by keys 1-6, template 7 as an "add-on", so to speak, since it re-programs the "<>|"-key (which is rarely used while writing), and not the "2"²"- and "#'"-key, as the previous six, so it can get used in conjunction with them. And as option 8, freely choosable programming for the 2-key and the #-key. In both cases ideally with templates to choose from a dropdown list (?) plus custom Unicode symbol code input (?), and for fields 3 and 4 (counted from left to right) additionally templates for Prime, Saltillo, 'Okina etc., representing "apostrophe-like" symbols (in case there are small/capital resp. "dual" versions of the symbol, simple press of "#" for small/single - field 3 [replacing the "#", as long as a "dual versions" symbol template is selected (?)], SHIFT+# for capital/double symbol - field 4). |
They should not interfere with Linux (at least I know of nothing). You can specify the shortcuts individually for each platform (https://webextension-api.thunderbird.net/en/78/commands.html). If we want we could even have the user change the shortcut binding.
I think that's a good idea. But in the UI I would put it at the end to keep the "/' things together.
Not sure if I understood it 100% but I think it's doable and makes sense. For the first draft of the feature I would go without the dropdown lists. PS:
Good that I also have a German keyboard (am not on a Mac)... otherwise I would be confused as hell |
By "/"-things you mean the "either or"/radio button templates, I assume? My thought was that the "individual" template section should be at the very end, to emphasize that it's a totally separate entity/"can of worms" than the other preset ones. I also have the experience in mind, that those kind of "we're giving you 10 options to choose from, but if you're not satisfied with them, there's a custom setting option too" - to set a freestyle color, custom CSS, or whatever - menus tend to have their "on your own" buttons/section at the very end. I don't think that the "checkmark" box before the "custom layout" radio button would induce confusion, considering I'd also add a little "chevrons/guillemets are, if activated, usable in conjunction with the other templates, as they use the "<"-key independently" sentence in the add-on description text.
Just first, second and third key layouts in one swoop, to demonstrate all choices that a writing person is able to use. |
Which languages should we support?
I think German and English are given - anything else?
Should we include all quote rules we know of? (A quick search offered this)
Or only German and Englisch? I think French is also commonly used.
The text was updated successfully, but these errors were encountered: