Skip to content
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

Evaluate potential for localisation of hubs #92

Open
annakrystalli opened this issue Jul 17, 2023 · 1 comment
Open

Evaluate potential for localisation of hubs #92

annakrystalli opened this issue Jul 17, 2023 · 1 comment
Labels
feature a feature request or enhancement localisation
Milestone

Comments

@annakrystalli
Copy link
Member

annakrystalli commented Jul 17, 2023

There's been discussions on the potential for localising hub infrastructure recently.

I think the two main areas that would need translating are:

  1. The columns in mode output data files
  2. The std task ID properties in schema.

Accessing localised versions of std model output colnames

Given we've recently started exporting objects of std hub terms (e.g. std_colnames) and given a recommended option for accessing data through a package is through a dedicated function a possible option for localising std colnames is by:

  • turning std_colnames into a matrix, one row per language of translated terms.
  • Use a function that takes term names as an argument and the required language as the second to return the values in the language required:
library(hubUtils)

# Create matrix of localised terms
std_colnames_m <- std_colnames |> as.matrix() |> t()
std_colnames_m <- rbind(
    std_colnames_m,
    c("modelo_id", "tipo_valore", "id_valore", "valore")
)
row.names(std_colnames_m) <- c("en", "it")
std_colnames_m
#>    model_id    output_type   output_type_id   value   
#> en "model_id"  "output_type" "output_type_id" "value" 
#> it "modelo_id" "tipo_valore" "id_valore"      "valore"

std_colnames <- function(terms, lang = "en") {
    std_colnames_m[lang, terms]
}

# Access localised version of terms
std_colnames("model_id")
#> [1] "model_id"

std_colnames(c("output_type", "output_type_id", "value"))
#>      output_type   output_type_id            value 
#>    "output_type" "output_type_id"          "value"
std_colnames(c("output_type", "output_type_id", "value"), "it")
#>    output_type output_type_id          value 
#>  "tipo_valore"    "id_valore"       "valore"

Created on 2023-07-17 with reprex v2.0.2

@nickreich
Copy link
Contributor

Noting that in another discussion about this request, it arose that perhaps we could broaden the scope of this issue to not just address "localization"/"internationalization" but also if a hub just wanted to use names for std_colnames that were more intuitive for their group. E.g., could a hub decide that a better set of names might be:
(value_type, value_type_idx, value)
Could a solution to the "localization" problem also introduce the ability for teams (or the hubverse org) to specify "allowable" sets of std_colnames?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement localisation
Projects
Status: Wishlist
Development

No branches or pull requests

2 participants