-
Notifications
You must be signed in to change notification settings - Fork 6
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
Swedish language support #35
Comments
Hi @Timmyfox , thank you. This is most welcome, and I'll add it, of course. But, before I do so, some comments and questions. I see you haven't included gender in the language declaration and for each of the types. Is it because in Swedish the articles do not inflect (as in English)? How do articles work in Swedish? (I have no idea...). Also, it seems there's some relation with German, so does Swedish also have (noun) declension? Btw, did you have a chance to take a look at the "Localization guidelines" at
Well... I do expect you to be more sure than that before we release it. ;-) |
Hey!
Also, as a final note, the biggest thing I'm not 100% sure about is the plural usage. To my understanding as a native speaker and a graduate student, Swedish actually uses singular forms for most reference types even for plural references. For example, Swedish would write "Figure 5 and 6" instead of "Figures 5 and 6", although there were a few cases where I was uncertain and couldn't find any useful sources, so I will check with my linguistics professor for further clarification. Primarily the case where this would differ is with definite cases (e.g. "The figures 5 and 6"). Cleveref, for comparison, simply uses the singular word consistently for both singular and plural cases. I will provide an update once I have gotten clarification on this. |
For
Ok, if it's just the possessive, the case is then similar to English, which the package doesn't actually include. (Nobody demanded it yet, and I agree with your judgement there).
Great!
Ok, we are on the same page here. What I meant is that I cannot check this for you, since I haven't the faintest of Swedish. And since this is meant to be published, I expect it to be carefully done. But, as long as you are confident, that's enough for me, and I have to rely on you. Regarding test files, the package has plenty of them (see the
Ok, please check this, if you can. Within reason, of course. It is fine if things are "to the best of your knowledge so far". And, if even after trying to check you are really divided about it, following
I'm looking forward to it. Thank you. |
Ah, another practical question. Do you know if |
Right, in this case the definite article in Swedish is a suffix as part of the word itself, thus then it shouldn't be needed as there is no preceding article. The one case it could make a difference is for the indefinite article, where it works almost identically to English (a figure, an appendix), but that goes beyond what is relevant here as if that's not needed for English it wouldn't be needed for Swedish.
No, and I can't think of any such that would be relevant here either. The only plausible variant would be Finland Swedish, although this is (officially anyway) considered more of a dialect than a variant and I'm not familiar enough with the differences to make a conclusive judgement. Babel doesn't include it however, so therefore I don't think it needs to be here either. |
Oh, my... The more I learn about this kind of thing, the more I have to recognize how naïve some of my assumptions were for the package, and on how much flexibility would be needed to properly support language specific needs like these. If the article is a suffix as part of the word itself the package can't handle it... I felt like I had a clear case in writing stuff like this in the manual:
But if the article is a suffix to the type name itself... But, well, That's more or less what In practical terms, I take it
Agreed.
My only concern is with what |
I don't believe this is a problem here actually. To clarify: the word for figure in Swedish is "figur". The full indefinite form with article ("a figure") is "en figur", the "en" here indicating common gender (the other gender form, neuter gender, using "ett" instead—similar to how English uses a/an). In the definite form, this gets appended to the word as a suffix, so "the figure" is "figuren", similar to how Spanish uses -a or -o to indicate gender (la figura, el figuro). The word for "chapter" ("kapitel") is neuter gender, so the indefinite form with article would be "ett kapitel" (a chapter), and the definite form is "kapitlet" (the chapter). The only difference here is whether an -en or an -et suffix is used for word in definite form. Why I don't think this is a problem is because this is completely self-contained and has no bearing on the surrounding words, nor does it change in any way. Thus, there is only one form per type name without any need for extra logic to handle the suffixes. It's merely a grammatical feature dictating how the word is formed. |
Let me see if I understand this correctly. The package does not have a way to "choose" between the definite or indefinite forms (or "no article" for that matter). What you are saying is that, since this is a reference to a specific numbered object, we'll always be using the definite form. Is that your point? Why would anyone say "a chapter 5" instead of "(the) chapter 5". Indeed, one wouldn't. Ok, this sounds a little less bad for my naïve assumptions. ;-) And, reiterating the question: the language should be declared without |
Yes, pretty much! And because of this the gender declaration would be entirely unnecessary as the package wouldn't need to consider the article at all as it'd already be "baked in", fully self-contained in the type name wherever applicable. Although what I was going to double check with my language teacher is that the convention appears to be to use the singular indefinite form both for singular and plural cases (so "figure 5 and 7" or "chapter 4 and 7"), meaning that the entire thing above regarding definite article suffixes would be moot anyway. However, in thinking about it further I also came up with a second potentially acceptable convention specifically for plural cases of using the plural definite form, the equivalent of writing "the figures 4 and 6", which would then be the only time the definite form would even be relevant. I'm not certain this is considered proper/correct though, but could in theory be a plausible style choice. If so, my initial thought was that it could be added as an optional declension case, unless the package might have support in any other way to choose between style variants. For figures, this could look something like this:
Where Similarly, the word for "page" ("sida") has two possible ways it can be written, which I also believe to boil down to style choice, which could perhaps also be most easily implemented as an optional declension case. |
Ok, thanks for clarifying. Sounds good then.
I leave this to your care and discretion.
Mhm... This is what I meant by:
In other words, this is not "declension" is it? To be clear, I'm not against it, if it's important. But, if it is, we could possibly consider the case of using a more general name for the option, something like "variant". This is actually not a bad idea... |
Not strictly, no. I consider it more of a variant that, if applied, should be used consistently throughout the document much in the same manner as abbreviated forms work. |
Sometimes, just changing perspective a bit can really topple things. I just opened a weird but very interesting "box" with that and I'm starting to think that just renaming "declension" with "variant" and allowing for a wider semantic meaning for the already existing infrastructure means the package can handle a lot more things... :-) The case at hand is the distinction between the definite/indefinite alternatives. But it could be anything else. See, why can't we have a variant "with preposition X"? Or "Y"? Say, in German, if we add a "variant" Let me think about this a bit, since the potential repercussions are relevant and I might be missing some blocking issue at first glance. (This only affects whether we can use "declension" meaning "variant", anything else remains the same, and you can go ahead with it.) |
@Timmyfox I took the plunge and decided to interpret type name variants more broadly, thus I have renamed "declension" to "variants" (and the other associated options). See f01b261 Feel free to use it. Or not. That is, there's no need to feel obligated just because I made the change in the context of our discussion. I'm aware you were still just considering the possibility. And I did rename it because I thought it was a good idea in general. In other words, use it only if it makes sense for Swedish, otherwise, you shouldn't, so don't worry. ;-) Now, given I've made these changes, depending on how you go about this, you may no longer be able to test things from the released version of the package. So I made a preliminary commit adding Swedish localization (c3c2bd9), so that you can build and test from there to polish things. I have no idea if you have some acquaintance with |
Alright! I received an email reply from my language professor and I received an answer to most of my questions. For most part it was just as I had suspected—singular indefinite case for everything. This means however also that most of the variants I had considered also shouldn't be used and this leaves only a single typename (page) with a variant (sida / sidan). I'm thinking of calling these Additionally, on the subject of abbreviations perhaps there could also be a way to enable/disable specific abbreviations? For example, the current implementation of abbreviations (to my understanding) only allow all on or all off, but consider if someone might want the abbreviation "fig." for figures, but not "p." for pages. With variants, one could selectively use the latter (or globally set it to always be used), without affecting the usage of the former. |
Great.
The first variant of the list in the language declaration is already (and always) the default. But, in the language file you should specify it. And what exactly do you mean by "avoid a bunch of duplication"? Indeed, if you define variants, I'd expect you to set all (four, or more) name forms for each variant and each type. Which makes me wonder if it's just for page, if it's worth it and/or how to deal with it. Please elaborate.
This is already possible, |
When referencing a page, there are two valid ways of doing this in Swedish: you can write either "sida" ("page") or "sidan" ("the page"), both are equally acceptable and which you choose is a matter of style and preference. Thus, here is makes sense to include both of them as variants, and this is the only type name that would have a variant as well. However, whichever is chosen it should be used consistently throughout the document, hence it would be useful for the user to be able to select on a global level which variant to use. A third option as well is to abbreviate it: "Kapitel 5, s. 4" ("Chapter 5, p. 4"). However one may only wish to abbreviate it selectively in specific cases, so if referencing the page by itself you may want the full non-abbreviated form ("page 4") but when it's used like in the example there as part of a structural reference (together with the chapter type name) then the abbreviation could be preferred. And to clarify, when I say globally I mean user-side in |
Hmm, alright I've performed some RTFM and I think I've realized what you're saying regarding abbreviations. If I just omit the However, it doesn't seem possible to do this the other way around as
But not this:
|
For this I don't think we should use variants at all. Choose the most common/traditional one for the language file. And the user who prefers the alternative can just use I did broaden the scope of the option to "variants", the user can in principle use it quite flexibly, but as far as the language files are concerned, they should use variants only for justifiable grammatical situations which cannot be handled otherwise. If you told me "the article is part of the word, and we must be able to choose between the situation with the article and without the article", then ok, that would have been a good reason. Since this choice does not seem to be needed, I think we should refrain from setting variants for Swedish. For "style and preference alternatives" the right tool is just
Again, this is not really within the intended scope of the language files. Keep things general and clean. As far as
Indeed, this is not possible. But I think this would be neither desirable, nor meaningful. This is not really what variants are for, and you don't need them for this kind of thing. |
Indeed, this is documented behavior. See #23 and #4. In fact, this asymmetry a big reason why I recommend to be conservative with abbreviations in the language files in the localization guidelines. |
Understood, thanks! Then here should be the final/corrected version of the language file: zref-clever-swedish.txt The only types I was unable to (naturally) test was
Another point of note, for the I'll look into |
Great. Thank you! I've updated things with your changes (see ecf448a). It looks mostly good to me. There was one obvious repeated name for footnote, which I dropped. Besides that it also called my attention the setting Other than that, the only other comment is about
Oh, I guess I put you through more trouble than I had hoped for. I did tell you you could always generate the object with just newcounter/refstepcounter, but I guess I should have been more explicit. I think only \documentclass{article}
\usepackage[swedish]{babel}
\usepackage{zref-clever}
\usepackage{hyperref}
\newcounter{book}
\newcounter{endnote}
\newcounter{note}
\begin{document}
\refstepcounter{book}
\label{book1}
\refstepcounter{book}
\label{book2}
\refstepcounter{book}
\label{book3}
\refstepcounter{endnote}
\label{endnote1}
\refstepcounter{endnote}
\label{endnote2}
\refstepcounter{endnote}
\label{endnote3}
\refstepcounter{note}
\label{note1}
\refstepcounter{note}
\label{note2}
\refstepcounter{note}
\label{note3}
\zcref{book1, book2, book3, endnote1, endnote3, note1, note3}
\end{document} Well, it may be a little late to spare you from the trouble... Sorry for not being more explicit.
Mhm, now. Indeed, while
And, I just checked,
Nice! Good news is that it is much, much simpler than for |
Apparently yes. With the questions I asked my language professor I included one question about the correct way to reference multiple consecutive objects, whether it matters if someone writes
No problem! I understood your instruction, this was more just me wanting to be extra thorough. What I meant when I said "generate naturally" was that I intentionally tried to generate the labels not just artificially but also in a more "real" scenario using appropriate packages and environments. If anything, that also helped me flag a possible bug/incompatibility (
Right! To cite my sources here, since my language teacher gave me an inconclusive "normally, page references should be avoided in academic papers" instead of any real answer of which should be preferred. The main things I found which led me to choosing "sidan" were these:
...However, in checking these again, I discovered that there's a newer version of the manual I referenced in the second point, the 8th edition from 2014, although provided not by the government website but by ISOF (The Swedish Institute for Language and Folklore). This newer version does change the usage in the same section about abbreviations (section 11.4 on page 92) to use "sida" instead of "sidan" for the non-abbreviated form, but does not make any further examples or references like the 7th edition did. Judging by this new finding, I'm starting to feel like perhaps "sidan" is the more old-fashioned usage and "sida" the more modern such. The use of "sidan" in cross-referencing would also be the only valid one, because when including the page number in the footer you would indeed use the indefinite "sida" instead (presumably why
|
I must admit this hurts a bit my typographical sensitivities, but if that's how things are, no issue there. It seems this is the best information you were able to get, and a categorical statement at that, so I see no reason not to follow the recommendation. All good here then.
Ah, if that's what you had in mind, no problem. It is not a bad idea to "stress test" a package you are considering adopting. ;-) Btw, if you are curious about the technical side, check the "Limitations" section in the manual. The issue at hand is most likely about the value of Apropos, if you are interested in endnotes, I do recommend
Ah, nice. Some sources for a contentious case are good to have here on record. Thanks. And, yes, considering those, and With that, everything looks good to me. So we are clear to go from my side. Please confirm if everything is in order from your side as well. Once you do, I'll prepare a release so that you can enjoy it. ;-) |
Yep! All looks good. I realized that in doing all my testing I left out the |
Well, yes, this option is there to decide what to do when |
Makes sense! Setting it as the default for for all types sounds like a good idea then, let's go with that, so "3–4". |
Done! I went ahead and cut a release as well. I've sent it to CTAN so, if you use TeXLive, you should get it in a couple of days. Once again, thank you very much for this. And I do hope you enjoy it. :-) |
Hello! I discovered this package now after a recent Hyperref update has partially broken Cleveref. Unfortunately, I discovered that one of the biggest hurdles to being able to replace Cleveref with Zref-clever is that it lacks support for Swedish.
Therefore, I have gone ahead and created a language file for this. Most of it's based on Cleverefs translations, with some tweaks and modifications. I haven't tested it too thoroughly, so there might be some errors, but it should be correct enough for most part.
zref-clever-swedish.txt
The text was updated successfully, but these errors were encountered: