Upgrade to Pro — share decks privately, control downloads, hide ads and more …

글로벌 기업은 홈페이지에서 영어 번역을 어떻게 제공할까?

글로벌 기업은 홈페이지에서 영어 번역을 어떻게 제공할까?

2024년 12월 21일 GDG DevFest 송도 발표자료 입니다.

에어프레미아는 다양한 국가의 고객이 탑승하는 항공사 입니다. 그리고 글로벌 서비스는 다국어 제공이 필수입니다.
에어프레미아가 다국어를 잘 관리하기위해 했던 고민과 경험, 노하우를 공유합니다.

Seungmin 마량

December 21, 2024
Tweet

More Decks by Seungmin 마량

Other Decks in Programming

Transcript

  1. (അ) ীয೐ۨ޷ই ەझ ೐ۿ౟ ݒפ੷ (അ) GDE Android Korea (੹)

    ߛ௼࢟۞٘ ೐ۿ౟ ݒפ੷ (੹) ٘ۄ݃ঙஹಌפ উ٘۽੉٘ ѐߊ੗ ੉थ޹
  2. (അ) ীয೐ۨ޷ই ەझ ೐ۿ౟ ݒפ੷ (അ) GDE Android Korea (੹)

    ߛ௼࢟۞٘ ೐ۿ౟ ݒפ੷ (੹) ٘ۄ݃ঙஹಌפ উ٘۽੉٘ ѐߊ੗ ੉थ޹
  3. ӝࠄ੸ੋ ׮Ҵয ҙܻ ߑߨ 1 key-value ഋधਵ۽ ޙҳ ੷੢ {

    "booking_departure": "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, }
  4. ӝࠄ੸ੋ ׮Ҵয ҙܻ ߑߨ 2 э਷ key۽ ׮ܲ ঱য value

    ੷੢ { "booking_departure": "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, } { "booking_departure": “Departure Date", "booking_schedule": "Select fare", "booking_select": "Select the schedule.", "booking_done": "successfully booked", } 🇰🇷 🇺🇸
  5. ӝࠄ੸ੋ ׮Ҵয ҙܻ ߑߨ 3 ঱য, key чਸ ֈѹ ਗೞח

    valueী ੽Ӕ { "booking_departure": "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, } { "booking_departure": “Departure Date", "booking_schedule": "Select fare", "booking_select": "Select the schedule.", "booking_done": "successfully booked", } ko, booking_departure en, booking_departure
  6. ӝઓ ׮Ҵয ҙܻ ߑߨ੄ ޙઁ੼ 1. key-valueо ׮Ҵযܳ ࢎਊೞח ೐ۿ౟ী

    হ׮. 
 adminী оࢲ ࠊঠೞפ ௏٘ оةࢿ ೞۅ. 2. ডҙ э੉ ӟ ޙҳب ޙ੢ ױਤ۽ ١۾غয ੓য ഝਊ੉ য۵׮. 3. ޙҳ ߸҃ ൤झషܻо হ׮.
  7. ߄ԲҊ र਷ ݽण 1. key-valueо ׮Ҵযܳ ࢎਊೞח ೐ۿ౟ী হ׮. key-valueܳ

    ೐ۿ౟ীࢲ ߄۽ ࠅ ࣻ ੓ب۾ ׮Ҵয ࣗझ ׮਍۽٘ 2. ডҙ э੉ ӟ ޙҳب ޙ੢ ױਤ۽ ١۾غয ੓য ഝਊ੉ য۵׮. static ੢ޙ਷ md۽ ҙܻ 3. ޙҳ ߸҃ ൤झషܻо হ׮. ־о, ঱ઁ, যڌѱ ߸҃೮ח૑ ൤झషܻ ҙܻ
  8. sourceۆ? ߣ৉ೞӝ ੹ ਗޙ key-value ૒੽ ੘ࢿ ೙ਃ { "booking_departure":

    "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, }
  9. ׮Ҵয ࣗझ ߉ӝ POо ೠҴয Source স۽٘ (csv) ೐ۿ౟ীࢲ csv

    ׮਍۽٘, json ౵य ߣ৉ ׮Ҵয ࢎਊೞӝ
  10. ׮Ҵয ࣗझ ߉ӝ echo ">> 🌐 Download from Crowdin” #

    Download source files echo ">> 🇰🇷 Download source files" crowdin download sources --verbose # Download translations echo ">> 🌐 Download translations" crowdin download --verbose # Execute the script node ./scripts/generate-crowdin.js async function convertCsvToJson() { const fileNameArr = [koFileName, enFileName, jaFileName]; console.info(">> 🔧 JSON ߸ജ द੘”); fileNameArr.forEach((fileName) => { Papa.parse(fs.readFileSync(`${fileName}.csv`, "utf8"), { complete: (results) => { const data = {}; results.data.forEach((row) => { const key = row[0].replace(/[\b]/g, ""); // Remove backspace const value = row[1] .replace(/[\b]/g, "") .replace(/\\n/g, "<br />"); // Convert Line Break data[key] = value; }); fs.writeFileSync(`${fileName}.json`, JSON.stringify(data)); }, }); }); console.info(">> 🚀 JSON ߸ജ ৮ܐ"); } CLI۽ ߉Ҋ json ߸ജ
  11. ӝࠄ੸ੋ ׮Ҵয ҙܻ ߑߨ ঱য, key чਸ ֈѹ ਗೞח valueী

    ੽Ӕ { "booking_departure": "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, } { "booking_departure": “Departure Date", "booking_schedule": "Select fare", "booking_select": "Select the schedule.", "booking_done": "successfully booked", } ko, booking_departure en, booking_departure
  12. ׮Ҵয ࢎਊ੄ ೨ब ঱য, key чਸ ֈѹ ਗೞח valueী ੽Ӕ

    { "booking_departure": "оחզ", "booking_schedule": "ੌ੿ࢶఖ", "booking_select": "ੌ੿ਸ ࢶఖ೧ ઱ࣁਃ.", "booking_done": "৘ড৮ܐ”, } { "booking_departure": “Departure Date", "booking_schedule": "Select fare", "booking_select": "Select the schedule.", "booking_done": "successfully booked", } ko, booking_departure en, booking_departure
  13. key ࢎਊ <PageTitle title={dictionary.services_purchase} category={dictionary.services_additional} /> import webKo from "@/dictionaries/ko/web.json";

    loadWeb = (lang: Locale) => { if (lang === "ko") { return webKo; } if (lang === "en") { return webEn; } }; import json
  14. valueী ߸ࣻ ઱ੑ <p> {t(“username_hello”, { username: ( <span className="text-orange">

    {user?.firstName} {user?.lastName} </span> ), })} </p> “username_hello”: "উ֞ೞࣁਃ {{username}}ש”, {{ }} ডࣘযী ߸ࣻܳ ઱ੑೞח hook ઁ੘
  15. pathী ঱য௏٘ ನೣ 📁 [lang] airpremia.com/ko/somePath airpremia.com/en/somePath export default function

    Layout({ children, params, }: { children: React.ReactNode; params: { lang: Locale }; }) ঱য ౸ױ
  16. pathী ঱য௏٘ হਵݶ Middlewareীࢲ ౸ױೞҊ redirect airpremia.com/somePath if (!pathUtil.hasPathLocale(pathname)) {

    const localeFromEnv = getLocaleFromEnv(request); const url = new URL( `/${localeFromEnv}${pathname}?${searchParams}`, request.url ); return NextResponse.redirect(url); } function getLocaleFromEnv(request: NextRequest) { const locales: string[] = i18n.locales; const languages = new Negotiator().languages(locales); return match(languages, locales, i18n.default); } export const i18n = { default: "ko", locales: ["ko", "en", "ja"], } as const; ঱য ౸ױ
  17. Crowdin ױ੼ mdী html ֍ਵݶ ઙઙ ߡӒ पदр ߸҃(over-the-air) ࠺ऱ׮

    ޙҳ ߸҃ೞ۰ݶ ߓನ ೙ਃ key ࢤࢿ оמೠ ݒפ੷ ࣻ ੸਺
  18. Crowdin ױ੼ mdী html ֍ਵݶ ઙઙ ߡӒ पदр ߸҃(over-the-air) ࠺ऱ׮

    ޙҳ ߸҃ೞ۰ݶ ߓನ ೙ਃ key ࢤࢿ оמೠ ݒפ੷ ࣻ ੸਺ 🤔 ੗୓ઁ੘ হ੉ ױ੼ਸ ࠁ৮ೡ ࣻ হਸө?
  19. Strapi ੢੼ ߸҃ द ߓನ হ੉ पदр ߈৔ ਋ܻ ੋ೐ۄীࢲ

    ઁҕೞפ ࠺ਊ੉ श ݒפ੷ ࣻ ޖઁೠ ׮Ҵয ޙҳܳ Strapi۽ ࢲࡂೞӝ
  20. Crowdin-Strapi۽ ׮Ҵয ҙܻೞӝ Crowdin ా೧ࢲ ׮Ҵয json, md ߉ӝ ೐ۿ౟ীࢲ

    strapiী api۽ ਃ୒೧ࢲ ׮Ҵয ߉Ҋ ࢎਊ strapiী ࠂࠢ
  21. Crowdin ా೧ࢲ ׮Ҵয json, md ߉ӝ strapiী ࠂࠢ const response

    = await fetch(`${path}?${params.toString()}`, { headers: { "Content-Type": "application/json", Authorization: `Bearer ${TOKEN}`, }, } Strapi api ೐ۿ౟ীࢲ strapiী api۽ ਃ୒೧ࢲ ׮Ҵয ߉Ҋ ࢎਊ
  22. Strapi ׮Ҵয ࢲࡂ੄ ױ੼ 1 Crowdinীࢲ ࠂࠢ੉ ӈଳ׮ Sourceо Crowdin,

    Strapi 2ѐৈࢲ ഒࢶ Crowdin-Strapi زӝച ೒۞Ӓੋ दب ৘੿
  23. Strapi ׮Ҵয ࢲࡂ੄ ױ੼ 2 Strapi ࢲߡ ౟ې೗ ҙܻ ݽٚ

    ޙҳ ࢲࡂ द (ࢲ࠺झ ౟ې೗ * N)੄ ࠗೞ
  24. Strapi ׮Ҵয ࢲࡂ੄ ױ੼ 2 ই૒਷ ੌࠗ݅ ࢲࡂ Strapi ࢲߡ

    ౟ې೗ ҙܻ ݽٚ ޙҳ ࢲࡂ द (ࢲ࠺झ ౟ې೗ * N)੄ ࠗೞ
  25. ӝઓ ׮Ҵয ҙܻ ߑߨ੄ ޙઁ੼ 1. key-valueо ׮Ҵযܳ ࢎਊೞח ೐ۿ౟ী

    হ׮. 
 adminী оࢲ ࠊঠೞפ ௏٘ оةࢿ ೞۅ. 2. ডҙ э੉ ӟ ޙҳب ޙ੢ ױਤ۽ ١۾غয ੓য ഝਊ੉ য۵׮. 3. ޙҳ ߸҃ ൤झషܻо হ׮.
  26. ীয೐ۨ޷ই੄ ׮Ҵয ҙܻ ߑߨ ੿ܻ POо ೠҴয Source স۽٘ (csv)

    ೐ۿ౟ীࢲ csv ׮਍۽٘, json ౵य ߣ৉ ׮Ҵয ࢎਊೞӝ
  27. Crowdin ױ੼ mdী html ֍ਵݶ ઙઙ ߡӒ पदр ߸҃(over-the-air) ࠺ऱ׮

    ޙҳ ߸҃ೞ۰ݶ ߓನ ೙ਃ key ࢤࢿ оמೠ ݒפ੷ ࣻ ੸਺
  28. Crowdin-Strapi۽ ׮Ҵয ҙܻೞӝ Crowdin ా೧ࢲ ׮Ҵয json, md ߉ӝ ೐ۿ౟ীࢲ

    strapiী api۽ ਃ୒೧ࢲ ׮Ҵয ߉Ҋ ࢎਊ strapiী ࠂࠢ
  29. Strapi ׮Ҵয ࢲࡂ੄ ױ੼ Crowdinীࢲ ࠂࠢ੉ ӈଳ׮ Sourceо Crowdin, Strapi

    2ѐৈࢲ ഒࢶ Strapi ࢲߡ ౟ې೗ ҙܻ ݽٚ ޙҳ ࢲࡂ द (ࢲ࠺झ ౟ې೗ * N)੄ ࠗೞ