」工欲善其事,必先利其器。「—孔子《論語.錄靈公》
首頁 > 程式設計 > 語言 API,允許您添加您的母語。

語言 API,允許您添加您的母語。

發佈於2024-11-08
瀏覽:887

Language API that allows you to add your native language to it.

早在2016 年4 月,我就有了為一個我非常喜歡的部落“Igede Language”創建一個字典項目的想法,我決定將其稱為“Igede Dictionary ”,儘管我不是“ t 是母語人士。

這讓我撰寫並翻譯了 5,000 多個單詞,從 Igede 語言翻譯成英語。毫無疑問,這是我曾經研究過或擁有過的所有想法中最艱難的。

這個計畫本應在 2018 年啟動。但是,2018 年發生了一些事情,這對我來說是一次非常痛苦的經歷。

在使用 WebView 處理 Android 專案時,我需要運行該套件並建置到生產環境中。然而,當時我在這個專案中使用的是一台舊桌上型電腦,並決定購買一台二手設備來測試運行該應用程序,因為我的電腦只有Windows Vista,無法安裝Android 的所有軟體包studio 包括一個模擬器,我需要在計算機上測試該應用程式(也許,這就是我當時所知道的)。

然後我的好朋友推薦了另一個朋友,他​​當時要賣掉他的手機。你猜怎麼著?我付了電話費,還來不及取電話,我們就被警察逮捕了? ?

好吧,長話短說,我從來沒有手機,我在警察拘留期間睡覺,回到家後第一件事就是刪除了該項目。當時一點都不好笑。

這事件發生在2018年10月16日,30天後我就失去了我的父親。那段時期其實對我影響很大。我很沮喪,而且是個獨行者,直到2020年才與人接觸。

為此,我在 Facebook 上創建了一個擁有 3000 多名追蹤者的頁面,當我發現其他人最近也做了類似的專案時,我感到非常高興。

猜猜我做了什麼?

我編寫了一個完整的 API,使開發人員能夠在線上添加他們的語言。

此API功能:

  • 新增語言

  • 新增單字/片語

  • 發音

  • 管理語言的內容

  • 檢視意義、同義字等

  • 還有更多!

您可以用這個專案做什麼?

  • 將網站內容翻譯成母語

  • 用使用者的語言向使用者朗讀網頁內容(對盲人來說,在母語比外語更受尊重的地方)。

  • 你所能想到的一切。

範例程式碼(PHP):


//新語言 使用 ola_dictionary\olatunji_dictionary; $ola_dict = 新olatunji_dictionary(); //為您的語言建立新目錄 $new_dict = $ola_dict->new_dictionary("伊格德字典"); $status = json_decode($new_dict, $author); 迴聲 $status['status']; // 成功/失敗 // 為了方便您將來刪除、刪除或管理您的內容,請將「auth_key」保存在您的回應正文中。否則,您將來將無法管理您的內容,並且受我們的法律服務條款的約束。 // 預設情況下,所有新增的語言都可供公眾存取。如果您打算停用預設設置,請使用 `new_dictionary("您的語言字典的名稱", "author", false)`
//New Language 

use ola_dictionary\olatunji_dictionary;

$ola_dict = new olatunji_dictionary(); 

//create new directory for your language

$new_dict = $ola_dict->new_dictionary("Igede Dictionary"); 

$status = json_decode($new_dict, $author); 

echo $status['status']; // success / failed 

// to enable you delete, remove or manage your contents in future, please save the `auth_key` in your response body. Failure to do so, you lose access to manage your contents in future and, it is bound by our legal terms of service thitherward. 

// all languages added are accessible to the public by default. If you intend to disable the default setting, please use `new_dictionary("name of your language dictionary", "author", false)`

範例程式碼(PHP):


//刪除語言 使用 ola_dictionary\olatunji_dictionary; $ola_dict = 新olatunji_dictionary(); //從我們的平台中刪除目錄 $remove_dict = $ola_dict->remove_dictionary("Igede 字典", "auth_key"); $status = json_decode($new_dict); 迴聲 $status['status']; // 成功/失敗
//New Language 

use ola_dictionary\olatunji_dictionary;

$ola_dict = new olatunji_dictionary(); 

//create new directory for your language

$new_dict = $ola_dict->new_dictionary("Igede Dictionary"); 

$status = json_decode($new_dict, $author); 

echo $status['status']; // success / failed 

// to enable you delete, remove or manage your contents in future, please save the `auth_key` in your response body. Failure to do so, you lose access to manage your contents in future and, it is bound by our legal terms of service thitherward. 

// all languages added are accessible to the public by default. If you intend to disable the default setting, please use `new_dictionary("name of your language dictionary", "author", false)`

我什麼時候會發布它?

雖然這個專案很棒,但我還沒有資源、資金來託管、維護和維持它的運作。

因此,這個專案是否發布取決於是否有財力或資金來啟動它,因為沒有 API 的庫已經過時了。

原始碼一旦發布就會在 GitHub 上開源,任何願意使用它的人都可以使用。

這聽起來像是您願意支持的事情嗎?

透過我在 dev.to 上的個人資料中的電子郵件地址向我發送郵件或在下面發表評論,我將很樂意與您進一步討論該項目。

今天是星期日,我的偉大人民和我度過了美好的一天。你呢?

我喜歡喝咖啡☕。因此,您可以點擊下面的連結為我買一杯或更多。

buymeacoffee.com/olatunji

感謝您今天與我分享寶貴的時間。

直到我再次寫信給你。

版本聲明 本文轉載於:https://dev.to/dev_olatunji/language-api-that-allows-you-to-add-your-native-language-to-it-9oe?1如有侵犯,請聯絡study_golang@163 .com刪除
最新教學 更多>

免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。

Copyright© 2022 湘ICP备2022001581号-3