mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 07:41:02 +08:00
Basic translations?
This commit is contained in:
parent
7314a5fa8a
commit
61a7ecbf12
@ -33,8 +33,10 @@ const titleOrg = computed(() => props.title);
|
||||
const titleMaxRegexDetection = /[a-zA-Z0-9]{,10}/;
|
||||
const title = ref("Draggable Window");
|
||||
onMounted(() => {
|
||||
if (!titleMaxRegexPattern.test(titleOrg.value)) {
|
||||
if (!titleMaxRegexDetection.test(titleOrg)) {
|
||||
console.log("Max Detected!!");
|
||||
} else {
|
||||
title.value = titleOrg;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -138,6 +138,7 @@ const formatTime = (timestamp: any) => {
|
||||
minute: "2-digit",
|
||||
}).format(timestamp);
|
||||
};
|
||||
const scrollToBottom = () => {};
|
||||
</script>
|
||||
<template>
|
||||
<blurPageBeforeLogin>
|
||||
|
@ -1,4 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
// Translate stuff
|
||||
interface translateInterfaceText {
|
||||
translateText: string;
|
||||
}
|
||||
const translateItems: Record<string, translateInterfaceText> = {};
|
||||
|
||||
// Imports
|
||||
import { ScanEyeIcon, RefreshCcwIcon } from "lucide-vue-next";
|
||||
import {
|
||||
Tooltip,
|
||||
@ -7,6 +14,7 @@ import {
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import { AhoCorasick } from "@monyone/aho-corasick";
|
||||
import translate from "translate";
|
||||
|
||||
async function CheckKidUnfriendlyContent(title: string, words: any[]) {
|
||||
try {
|
||||
@ -194,6 +202,7 @@ const openPublisher = (slug: string, title: string) => {
|
||||
emit("openNewsSourcePage", slug, title);
|
||||
};
|
||||
const isLoading = computed(() => contentArray.value.length === 0);
|
||||
const testmessage = await translate("Hi", { from: "en", to: "es" });
|
||||
</script>
|
||||
<template>
|
||||
<div class="justify-center align-center text-center">
|
||||
@ -224,7 +233,7 @@ const isLoading = computed(() => contentArray.value.length === 0);
|
||||
class="disabled:cursor-not-allowed"
|
||||
:disabled="isPrimary(item.url, true) || switchTabs"
|
||||
>
|
||||
<span>{{ item.text }}</span>
|
||||
<span>{{ locale === "en" ? item.text : testmessage }}</span>
|
||||
</button>
|
||||
</template>
|
||||
<button v-if="canNotLoadTabUI"><RefreshCcwIcon /></button>
|
||||
|
@ -37,6 +37,9 @@ function cleanUpSlug(orgslug: string) {
|
||||
}
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const translateQuery = getQuery(event).translate;
|
||||
const translate = translateQuery === "true" ? true : false;
|
||||
console.log(translate);
|
||||
const slug = getRouterParam(event, "slug");
|
||||
const cleanSlug = cleanUpSlug(slug);
|
||||
if (
|
||||
|
Loading…
x
Reference in New Issue
Block a user