From 0de83070c7e5f8d89a526e30b2459da748347034 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Tue, 14 Mar 2023 09:41:07 +0100 Subject: [PATCH] Add IPA transcription --- src/main.rs | 6 +++--- static/index.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1b36f94..88e5edb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ -#![feature(slice_group_by, path_try_exists)] +#![feature(slice_group_by, fs_try_exists)] use std::process::exit; -use std::fs; +use std::path::Path; //mod database; use rocket::routes; @@ -95,7 +95,7 @@ async fn main() { views::get_langs, views::frontend]); - if let Ok(_) = fs::try_exists(FRONTEND_DIR) { + if let Ok(_) = Path::new(FRONTEND_DIR).try_exists() { app = app.mount("/static", FileServer::from(FRONTEND_DIR)); } diff --git a/static/index.js b/static/index.js index d592a14..4edcd61 100644 --- a/static/index.js +++ b/static/index.js @@ -184,7 +184,7 @@ $(document).ready(() => { html += `

Not found: ${decodeURIComponent(word)}

`; } else { data.forEach(entry => { - html += `

${entry.word} (${entry.pos})

` + html += `

${entry.word} ${entry.sounds[0].ipa} (${entry.pos})

` if('senses' in entry) { let tags = []; entry.senses.forEach(sense => {