-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add support for other languages #2
Comments
Great idea! I'd definitely would like to merge it in -- multi-language support would be super useful. |
I found out that in order to solve the problem mentioned there needs to be a dedicated way to handle apostrophes for abbreviations. This is not a problem in English since you just use the same symbol that you use for a single quotation mark. This is not the case in German and French though. So there needs to be a way to properly find those. Any ideas? |
👍 |
@k-nut: I appreciate that you're probably not interested in doing this any more, but if you are (or if anyone else wants to have a go), I think a state machine would be useful here. Unfortunately, most libraries to do that in JS are bigger than this library! Still, I think it would be a useful feature—possibly in another file (smartquotes.js and smartquotes.multilang.js`?). |
Hey @callumacrae I would sure love to finish this. I got the German version running after all and would at least like to include that. How do you think a state machine could be useful here? And splitting this into another file for multilang support seems like a good idea! |
I'm not sure, but if you gave me a specific case where regular expressions wouldn't do the trick, I could try to explain an example. |
Well one problem for example are years like |
I see. So de and fr use different characters for quotes and abbreviations, which en uses the same? I can't see any way around that short of replacing both the start and end quote at the same time. I wonder how other libraries handle this. |
As far as I am able to tell that is right. I'm not a language/typography expert though... Good question how the other libraries handle this! |
I can't even find any other libraries that do this! |
Other languages such as German and French use different ways to quote. I implemented a basic mechanism to adapt to the language of the document which is set via
<html lang='de'>
. You can try it out with the commits from my fork. It seems to work for German but the French is getting mixed up by the'em
in one of the first paragraphs in the badger.html. Would you like to merge this into your version once it is working?The text was updated successfully, but these errors were encountered: