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

Update translations for alien species portal v1.1.0 #253

Open
mvarewyck opened this issue Sep 27, 2024 · 7 comments · Fixed by #317
Open

Update translations for alien species portal v1.1.0 #253

mvarewyck opened this issue Sep 27, 2024 · 7 comments · Fixed by #317
Assignees

Comments

@mvarewyck
Copy link
Collaborator

Some translations are missing here

@mvarewyck
Copy link
Collaborator Author

I also get missing translations for following regions: Buetgenbach, Ouderghem
If no translation needed, no action needed. If you want to include a translation for these, please add them to translations_regions.csv
(They might be already in the translations for another id, but then not same id is used in all datasets)

@SanderDevisscher
Copy link
Collaborator

SanderDevisscher commented Oct 14, 2024

Both Buetgenbach & Ouderghem are in translation_region with another id (resp. Bütgenbach & Oudergem)

@mvarewyck can you indicate in which datasets Buetgenbach & Ouderghem occur ?

@soriadelva I think it is a good idea to expand the translation check to every dataflow.

SanderDevisscher added a commit that referenced this issue Oct 14, 2024
SanderDevisscher added a commit that referenced this issue Oct 14, 2024
SanderDevisscher added a commit that referenced this issue Oct 14, 2024
SanderDevisscher added a commit that referenced this issue Oct 14, 2024
SanderDevisscher added a commit that referenced this issue Oct 17, 2024
SanderDevisscher added a commit that referenced this issue Oct 17, 2024
SanderDevisscher added a commit that referenced this issue Oct 21, 2024
@mvarewyck
Copy link
Collaborator Author

@mvarewyck can you indicate in which datasets Buetgenbach & Ouderghem occur ?

These are in the occurrence data be_alientaxa_cube.csv, column NAAM

@SanderDevisscher
Copy link
Collaborator

@mvarewyck can you indicate in which datasets Buetgenbach & Ouderghem occur ?

These are in the occurrence data be_alientaxa_cube.csv, column NAAM

Ok, I'm currently reworking the be_alien_cube flow, see #18. I'll fix this is issue there.

@SanderDevisscher
Copy link
Collaborator

SanderDevisscher commented Dec 19, 2024

library(shiny)
library(dplyr)
library(readr)
library(htmltools)

# Load the data
data_url <- "https://raw.githubusercontent.com/inbo/aspbo/uat/data/output/UAT_direct/translations.csv"
translations <- read_csv(data_url)

# Define UI
ui <- fluidPage(
  titlePanel("Translation Editor"),
  
  sidebarLayout(
    sidebarPanel(
      selectInput("title_id", "Select Title ID:", choices = unique(translations$title_id)),
      selectInput("language", "Select Language:", choices = c("en", "fr", "nl")),
      actionButton("save", "Save Changes")
    ),
    
    mainPanel(
      textInput("title_unformatted", "Title (Unformatted):"),
      htmlOutput("title_rendered"),
      textInput("description_unformatted", "Description (Unformatted):"),
      htmlOutput("description_rendered")
    )
  )
)

# Define server logic
server <- function(input, output, session) {
  
  # Reactive expression to filter data based on selected title_id
  filtered_data <- reactive({
    translations %>% filter(title_id == input$title_id)
  })
  
  # Update text inputs when title_id or language changes
  observe({
    req(filtered_data())
    lang_col_title <- paste0("title_", input$language)
    lang_col_description <- paste0("description_", input$language)
    
    updateTextInput(session, "title_unformatted", value = filtered_data()[[lang_col_title]])
    updateTextInput(session, "description_unformatted", value = filtered_data()[[lang_col_description]])
  })
  
  # Render HTML for title and description
  output$title_rendered <- renderUI({
    req(input$title_unformatted)
    HTML(input$title_unformatted)
  })
  
  output$description_rendered <- renderUI({
    req(input$description_unformatted)
    HTML(input$description_unformatted)
  })
  
  # Save changes back to the CSV file (placeholder functionality)
  observeEvent(input$save, {
    req(filtered_data())
    
    # Update the translations data frame with the new values
    lang_col_title <- paste0("title_", input$language)
    lang_col_description <- paste0("description_", input$language)

    translations[translations$title_id == input$title_id, lang_col_title] <<- input$title_unformatted
    translations[translations$title_id == input$title_id, lang_col_description] <<- input$description_unformatted
    
    # Save to CSV (this will overwrite the existing file; adjust as needed)
    write_csv(translations, path = "translations.csv")
    
    showModal(modalDialog(
      title = "Success",
      "Changes have been saved successfully!",
      easyClose = TRUE,
      footer = NULL
    ))
  })
}

# Run the application 
shinyApp(ui = ui, server = server)

SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 19, 2024
SanderDevisscher added a commit that referenced this issue Dec 20, 2024
SanderDevisscher added a commit that referenced this issue Dec 20, 2024
SanderDevisscher added a commit that referenced this issue Dec 20, 2024
SanderDevisscher added a commit that referenced this issue Dec 20, 2024
@SanderDevisscher
Copy link
Collaborator

SanderDevisscher commented Jan 8, 2025

Issues with translations

  • EN version of taxa table Aperçu du tableau should be Table overview.
  • Check translations of "TrIAS indicatoren" at GAMs

@soriadelva After these are fixed I suggest we do a PR and create a new branch when we work on it again

SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
SanderDevisscher added a commit that referenced this issue Jan 9, 2025
@SanderDevisscher SanderDevisscher linked a pull request Jan 9, 2025 that will close this issue
@SanderDevisscher
Copy link
Collaborator

ongoing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants