Skip to content

Commit

Permalink
added localization
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsam committed Feb 12, 2025
1 parent 47d5e01 commit 33f91fb
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 9 deletions.
31 changes: 27 additions & 4 deletions static/img/translation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion static/js/LayoutButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const LayoutButtons = () => {
const layoutState = calculateLayoutState(language, textsData, panelMode);
return (
<div className="layout-button-line" role="radiogroup" aria-label="text layout toggle">
<InterfaceText>Layout</InterfaceText>
<InterfaceText>text.reader_option_menu.layout</InterfaceText>
<div className="layout-options">
{layoutOptions[layoutState].map((option, index) => <LayoutButton
key={index}
Expand Down
2 changes: 1 addition & 1 deletion static/js/Misc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ const FontSizeButtons =() => {
>
<img src="/static/icons/reduce_font.svg" alt=""/>
</button>
<InterfaceText>Font Size</InterfaceText>
<InterfaceText>text.reader_option_menu.font_size</InterfaceText>
<button
onClick={()=>setOption('fontSize', 'larger')}
className="font-size-button preventClosing"
Expand Down
7 changes: 4 additions & 3 deletions static/js/SourceTranslationsButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useContext} from "react";
import PropTypes from "prop-types";
import {ContentLanguageContext} from "./context";
import {RadioButton} from "./Misc";
import Sefaria from './sefaria/sefaria';

function SourceTranslationsButtons({ showPrimary, showTranslation, setShowTexts }) {
const {panelMode} = useContext(ContentLanguageContext);
Expand All @@ -19,9 +20,9 @@ function SourceTranslationsButtons({ showPrimary, showTranslation, setShowTexts

return (
<div className="show-source-translation-buttons" aria-label="Source-translation toggle">
{createButton(true, false, 'Source')}
{createButton(false, true, 'Translation')}
{!isSidePanel && createButton(true, true, 'Source with Translation')}
{createButton(true, false, Sefaria._('text.reader_option_menu.source'))}
{createButton(false, true, Sefaria._('text.reader_option_menu.translation'))}
{!isSidePanel && createButton(true, true, Sefaria._('text.reader_option_menu.source_with_translation'))}
</div>
);
}
Expand Down
3 changes: 3 additions & 0 deletions static/js/sefaria/localizationLanguage/chinese.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
"sheet.create_new": "创建新项目",
"sheet.publish_setting": "发布设置",
"sheet.published": "已发布",
"text.reader_option_menu.source": "来源",
"text.reader_option_menu.translation": "翻译",
"text.reader_option_menu.source_with_translation": "原文与翻译",
"text.reader_option_menu.color": "颜色",
"text.reader_option_menu.font_size": "字体大小",
"text.reader_option_menu.punctuation": "标点",
Expand Down
3 changes: 3 additions & 0 deletions static/js/sefaria/localizationLanguage/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
"sheet.publish_setting": "Publish Settings",
"sheet.published":"Published",
"text.reader_option_menu.color":"Color",
"text.reader_option_menu.source": "Source",
"text.reader_option_menu.translation": "Translation",
"text.reader_option_menu.source_with_translation": "Source with Translation",
"text.reader_option_menu.font_size":"Font Size",
"text.reader_option_menu.punctuation":"Punctuation",
"text.reader_option_menu.show_puntuation":"Show Punctuation",
Expand Down
3 changes: 3 additions & 0 deletions static/js/sefaria/localizationLanguage/tibetan.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
"sheet.create_new": "གསར་པ་བཟོ།",
"sheet.publish_setting": "སྤེལ་གྱི་སྒྲིག་འགོད།",
"sheet.published": "འབྲི་བཞག",
"text.reader_option_menu.source": "ཁུངས།",
"text.reader_option_menu.translation": "འགྱུར་མ།",
"text.reader_option_menu.source_with_translation": "ཁུངས་དང་འགྱུར་མ།",
"text.reader_option_menu.color":"ཚོན་མདོག",
"text.reader_option_menu.font_size":"ཡིག་གཟུགས་ཆེ་ཆུང་།",
"text.reader_option_menu.punctuation":"ཚེག་ཤད།",
Expand Down

0 comments on commit 33f91fb

Please sign in to comment.