-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Domain** * 22 new attributes (required for Horizon Europe) **Conditions** * Four new conditions **Options** * Additional options: `infrastructure_resources/262` "Fast read and write of data is required (high performance storage)", `preservation_repository_options/138` "Another partner institution" * Removed option: `dataset_size_options/253` "not yet defined" * Localisation in French and Italian; minor language adjustments in English and German **Catalogs** * New questions: `topic-research_field/name`, `long-term-preservation-datasets/responsible_person_name` , `long-term-preservation-datasets/responsible_person_email` * Broken attribute reference in catalogs rdmo.xml, bielefeld.xml, snf.xml repaired * DFG and CC links updated * Orthography corrections (spaces, newlines, lists, quotes, special characters) in catalogs rdmo.xml, dcc.xml, fhpshort.xml, catalog_VW_SE.xml * Localisation of catalog rdmo.xml in French and Italian * Minor language adjustments in English and German question text * Additional help text where necessary **Community contributions** * Tabular overview of community catalogs * New catalog for Science Europe / VW Stiftung * FoDaKo documentation updated **Internationalisation** * New folder "localisation" containing R script and tables for the localisation of RDMO catalogues and optionsets
- Loading branch information
Showing
13 changed files
with
1,987 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# R script and tables for the localisation of RDMO catalogues and optionsets | ||
|
||
This folder contains tools which allow adding new languages to the RDMO XML files (presently catalogues and optionsets). | ||
|
||
The code is still "work in progress". | ||
|
||
Suggested procedure: | ||
|
||
1. Open the R script. If necessary, adjust the file names and paths. | ||
2. Add the new language to all relevant positions in the script (in particular after each occurrence of `Liste_it`, `Übersetzung_it`, `IT`). | ||
3. Run the first part of the script. This will extract all text chunks (titles, question texts, help texts, verbose names) as well as their XML path into a TSV file. | ||
4. Open the TSV file with a spreadsheet software or an advanced text editor. Add a new column with the new language. | ||
5. Translate the text into the new language. You may sort the table, provided you sort it back at the end. Don't delete the empty rows. | ||
6. Run the second part of the script. This will add the nodes in the new language as siblings to the existing ones in the XML file. | ||
7. Check the resulting XML file for consistency using an XML editor. | ||
8. Upload the resulting XML file to your RDMO instance (and possibly as a pull reqest here on GitHub). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
library(xml2); library(stringr); library(magrittr); library(tidyverse) | ||
# setwd("C:/Users/MYPATH") # enter path | ||
|
||
rm(list=ls()) | ||
Dateiname <- "PRONTO/rdmo-questions.xml" | ||
# Dateiname <- "rdmo-catalog-master/rdmorganiser/options/rdmo.xml" | ||
|
||
# Liste_fr <- Liste_it <- xml_find_all(read_xml(Dateiname),'.//*[@lang="de"]') | ||
Dokument <- read_xml(Dateiname) | ||
Liste_de <- xml_find_all(Dokument,'.//*[@lang="de"]') | ||
Liste_en <- xml_find_all(Dokument,'.//*[@lang="en"]') | ||
Liste_fr <- xml_find_all(Dokument,'.//*[@lang="fr"]') | ||
Liste_it <- xml_find_all(Dokument,'.//*[@lang="it"]') | ||
|
||
########################## | ||
# nuova tabella traduzione | ||
|
||
# Etiketten <- c(); for(x in Liste_de) Etiketten %<>% append(.,xml_text(xml_child(xml_parent(x),"key"))) | ||
DE <- data.frame( Pfad = str_replace(xml_path(Liste_de),"\\[\\d*\\]\\Z","") , de = xml_text(Liste_de) ) | ||
EN <- data.frame( Pfad = str_replace(xml_path(Liste_en),"\\[\\d*\\]\\Z","") , en = xml_text(Liste_en) ) | ||
FR <- data.frame( Pfad = str_replace(xml_path(Liste_fr),"\\[\\d*\\]\\Z","") , fr = xml_text(Liste_fr) ) | ||
IT <- data.frame( Pfad = str_replace(xml_path(Liste_it),"\\[\\d*\\]\\Z","") , it = xml_text(Liste_it) ) | ||
|
||
Übersetzung <- DE %>% | ||
full_join(EN,"Pfad") %>% | ||
full_join(FR,"Pfad") %>% | ||
full_join(IT,"Pfad") | ||
|
||
fix(Übersetzung) | ||
write_tsv(Übersetzung,"Traduzione00.tsv",na="", quote_escape="none") | ||
|
||
########################## | ||
# aggiornamento traduzione | ||
|
||
Übersetzung <- read_tsv("PRONTO/rdmo-questions-localisation.tsv") | ||
Übersetzung %<>% .[match(.$Pfad,DE$Pfad),] | ||
|
||
xml_set_attr(Liste_de,"lang","de") | ||
xml_set_attr(Liste_en,"lang","en") | ||
xml_set_attr(Liste_fr,"lang","fr") | ||
xml_set_attr(Liste_it,"lang","it") | ||
xml_set_text(Liste_de,Übersetzung$de) | ||
xml_set_text(Liste_en,Übersetzung$en) | ||
xml_set_text(Liste_fr,Übersetzung$fr) | ||
xml_set_text(Liste_it,Übersetzung$it) | ||
|
||
xml_remove(xml_find_all(Dokument,'.//*[@lang="fr"]')) | ||
xml_remove(xml_find_all(Dokument,'.//*[@lang="it"]')) | ||
for(.k in seq_along(Liste_de)) xml_add_sibling( Liste_de[[.k]],Liste_it[[.k]] ) | ||
for(.k in seq_along(Liste_de)) xml_add_sibling( Liste_de[[.k]],Liste_fr[[.k]] ) | ||
|
||
write_xml(Dokument,"rdmo-questions.xml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.