anki-geo / ultimate-geography

Geography flashcard deck for Anki
https://ankiweb.net/shared/info/2109889812
Other
761 stars 79 forks source link

Add Danish translation #623

Closed Munksgaard closed 4 months ago

Munksgaard commented 5 months ago

Here's my attempt at a Danish translation. I haven't been able to build it locally, so I hope the CI will make sure that everything compiles as it should.

I've used the following sources for names (in decreasing order of priority:

I am unsure what I am supposed to put in guid.csv, so I've left it untouched for now.

Munksgaard commented 5 months ago

I think I managed to generate the guids, but I still get an error when trying to run pipenv build:

$ pipenv run build
INFO:root:Builder file recipes/source_to_anki.yaml is ✔ good
INFO:root:Attempting to generate Guids
INFO:root:Generate guids complete
Traceback (most recent call last):
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/bin/brain_brew", line 8, in <module>
    sys.exit(main())
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/main.py", line 19, in main
    command.execute()
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/run_recipe.py", line 15, in execute
    recipe = TopLevelBuilder.parse_and_read(self.recipe_file_name, self.verify_only)
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/top_level_builder.py", line 60, in parse_and_read
    return cls.from_list(recipe_data)
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/recipe_builder.py", line 20, in from_list
    tasks = cls.read_tasks(data)
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/recipe_builder.py", line 68, in read_tasks
    task_or_tasks = [matching_task.from_repr(task_arguments)]
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/parts_builder.py", line 40, in from_repr
    return cls.from_list(data)
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/recipe_builder.py", line 20, in from_list
    tasks = cls.read_tasks(data)
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/commands/run_recipe/recipe_builder.py", line 68, in read_tasks
    task_or_tasks = [matching_task.from_repr(task_arguments)]
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/build_tasks/csvs/notes_from_csvs.py", line 56, in from_repr
    file_mappings=rep.get_file_mappings(),
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/build_tasks/csvs/shared_base_csvs.py", line 22, in get_file_mappings
    return list(map(FileMapping.from_repr, self.file_mappings))
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/transformers/file_mapping.py", line 76, in from_repr
    derivatives=list(map(cls.from_repr, rep.derivatives)) if rep.derivatives is not None else [],
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/transformers/file_mapping.py", line 68, in from_repr
    csv.read_file()
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/representation/generic/csv_file.py", line 47, in read_file
    self._data.append({key.lower(): row[key] for key in row})
  File "/home/munksgaard/.local/share/virtualenvs/ultimate-geography-wQmoXBY1/lib/python3.10/site-packages/brain_brew/representation/generic/csv_file.py", line 47, in <dictcomp>
    self._data.append({key.lower(): row[key] for key in row})
AttributeError: 'NoneType' object has no attribute 'lower'
Munksgaard commented 5 months ago

Seems like the same error happens in CI. Any clue as to how I can fix it?

aplaice commented 5 months ago

Thanks so much for the translation! (I'll have a closer look (mostly looking out for obvious typos — I don't know Danish :)) when I have more time, but on a casual glance it appears great!)


The build issue is a mismatch of row length and number of CSV headers (for a variety of reasons, in a couple of files.) Sorry that the error message is not very informative! I believe that I've fixed this here.

Munksgaard commented 5 months ago

Thanks so much for the translation! (I'll have a closer look (mostly looking out for obvious typos — I don't know Danish :)) when I have more time, but on a casual glance it appears great!)

The build issue is a mismatch of row length and number of CSV headers (for a variety of reasons, in a couple of files.) Sorry that the error message is not very informative! I believe that I've fixed this here.

Thank you for the fixes!

ohare93 commented 5 months ago

Sorry for the unhelpful error in Brain Brew, mate. I'll get it fixed for the next guy 😄

Also I am generally proficient in Danish 😃 though country names of the world are definitely not on my proficiency list 😅 I'm sure I can ask my wife (a native Dane) to give it a quick review though 💪

Munksgaard commented 5 months ago

Sorry for the unhelpful error in Brain Brew, mate. I'll get it fixed for the next guy 😄

Absolutely no worries! I should've just taken another look through the CSVs, but it got pretty late last night before I was finished with everything :D

Also I am generally proficient in Danish 😃 though country names of the world are definitely not on my proficiency list 😅 I'm sure I can ask my wife (a native Dane) to give it a quick review though 💪

That would be great. I'll also do another once over myself. Hopefully there aren't anymore big blunders on my part :-)

Munksgaard commented 5 months ago

Okay, I'm finding a bunch of things I want to change. I'll squash everything once I'm done, if you want me to.

Edit: My defense is that I didn't find out about https://sproget.dk/raad-og-regler/ordlister/andre-ordlister/lande-og-nationaliteter until I was pretty far into capital.csv (and maybe also country.csv? We'll see), and it seems to be the most official list.

Munksgaard commented 5 months ago

Okay, I think that was it. Please take a look at your leisure :-)

ohare93 commented 4 months ago

(capital.csv) I have slight doubts about the capital of the Vatican. Vatikanstaten feels very slightly weird — "Vatican Country" (if I understand correctly) as the capital.

I prompted my wife without context "What's the capital of the Vatican in Danish" and she answered "Vatikanstaten" right away.

(country.csv) I think that some of the names should have definite articles removed

Pretty much all of Danish countries and capitals are in the definitive 😁 "Den" does translate to "The" but so does the "n" at the end of "Vaticanstaten". Another example is "Størebritanien" is "The Great/Big Britain" 😅 it is very very strange to me still, as an English native, but that's just how they do it 🤷‍♂️ Whereas some cannot have the definitive at the end, and must have "Den" at the start instead due to grammar 😁 so I expect they should remain in your examples

Munksgaard commented 4 months ago

Thanks again for the translation! Other than a couple of potential issues, this looks amazing!

As noted I don't speak Danish (I have some vague knowledge of some related languages), so I'm very much not sure about some of these (the ones that aren't obvious typos); I also haven't checked for spelling/grammar errors.

(I've reviewed these off-line — GitHub's review tools aren't great for CSVs — so I'm listing these here rather than commenting in each file.)

1. (`capital.csv`) I have slight doubts about the capital of the Vatican. Vatikanstaten feels very slightly weird — "Vatican Country" (if I understand correctly) as the capital.
   OTOH our Norwegian and Swedish translations also already have Vatikanstaten — I probably didn't notice/think about it at the time..
   Strangely, I don't feel the same way the other way around ("Vatican City" as a country...).
   I wouldn't have brought this up if the sources were more definite about this. (AFAICT [Sproget doesn't list a capital](https://sproget.dk/raad-og-regler/ordlister/andre-ordlister/lande-og-nationaliteter#v), [neither does Den Store Danske](https://denstoredanske.lex.dk/Vatikanstaten).
   As a weird side note, [Swedish Wikipedia for the Vatican](https://sv.wikipedia.org/wiki/Vatikanstaten) lists Vatikanstaten as the capital city and Vatikanstaden as the largest city.
   (Probably Vatikanstaten (as-is) is correct, though — for all other languages I believe that we have the same name for the country and capital, which makes sense for a city-state.)

2. (`capital.csv`) Palakir as the captial for Federated States of Micronesia is a typo.

3. (`capital.csv`) I think that the capital of Kiribati should be the equivalent of South Tarawa (not Tarawa)
   (see [here](https://github.com/anki-geo/ultimate-geography/blob/master/CONTRIBUTING.md#capital-field) — we've had _many_ long discussions about such discrepancies and settled on this policy of English Wikipedia being the global ground truth regarding "facts" (e.g. whether the capital is Tarawa or just South Tarawa...) and only using per-language sources for the names of capitals/countries (which may include situations that a given city/country has multiple names in language X when it only has one name in English)).

4. (`capital_info.csv`) `Official capital was moved from Bujumbura to Gitega in 2019.` is untranslated.

5. (`country.csv`) I _think_ that some of the names should have definite articles removed (similarly to how we do it in French/German etc. and for English names that usually have "the" attached)), but I'm very much unsure (for Norwegian we've kept the articles in many of the same places)?  I'm mainly bringing this up because we have similar situations in other languages, but for Danish you'll know better than us.  A possibly incomplete list:
   Den Dominikanske Republik
   De Amerikanske Jomfruøer
   Den Europæiske Union
   Some of the Oceans (weirdly here Danish Wikipedia _does_ have definite articles in the article titles)
   Det Østsibiriske Hav (here again Danish Wikipedia _does_ have definite articles in [the article title](https://da.wikipedia.org/wiki/Det_%C3%98stsibiriske_Hav), but, say the [South China Sea](https://da.wikipedia.org/wiki/Sydkinesiske_Hav) does not, so I'm not sure whether this )
   Det Røde Have (same as for East Siberian sea)

6. (`country.csv`) "Det Røde Have" should (I think) be "Det Røde Hav". (Not sure whether presence/absence of article would change this.)

7. (`country_info.csv`) `Constituent country of the Kingdom of the Netherlands.` is untranslated.

8. (`flag_similarity.csv`) Yemen flag similarity `IRak` (capitalisation).

As usual, the cases that I'm least sure about have taken up the most space... Feel free to ignore 1 and 5 or just say that you think everything is fine there as-is, without going into details! :)

I have pushed corrections for points 2, 3, 4, 6, 7 and 8.

With regards to "Vatikanstaten", I have no strong feelings either way, but it should probably be the case that both the "country" and the "capital" share the same name, whether that is "Vatikanet" or "Vatikanstaten".

Regarding the definite articles: I don't know of any hard and fast rules around how country-names should be handled. Looking at it again, I'd actually rather go the other way and add the definite article to some countries that are missing it, like "Forenede Arabiske Emirater", "Keltiske Hav" and "Engelske Kanal". That would also match up to Norwegian.

Munksgaard commented 4 months ago

I've fixed a typo for Japan and added definite articles to all countries, so at least now we are consistent.

aplaice commented 4 months ago

Thanks very much for fixing the tiny typos/minor issues and replying to my other queries! I fully defer to your knowledge!


Pretty much all of Danish countries and capitals are in the definitive 😁 "Den" does translate to "The" but so does the "n" at the end of "Vaticanstaten".

Thanks for explaining!


Don't know how I ended up with "Jarap"...

:D (I also missed that when reviewing...)


I think we can squash and merge, unless @axelboc has any thoughts about something we've missed?

(We can obviously fix any possibly remaining typos etc. later.)

Thanks again for the translation! :) (Edit: I've added you to the list of translators, if that's OK?)

axelboc commented 4 months ago

Fantastic work, thank you so much!

Munksgaard commented 4 months ago

Thank you all for helping me out :heart: