Skip to content

Commit

Permalink
add more overriden translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mcayuelas-ledger committed Oct 25, 2023
1 parent dc8390f commit af02611
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Box from "~/renderer/components/Box";
import FeatureFlagEdit from "./FeatureFlagEdit";
import styled, { DefaultTheme, StyledComponent } from "styled-components";
import { FlexBoxProps } from "@ledgerhq/react-ui/components/layout/Flex";
import { useTranslation } from "react-i18next";

type Props = {
flagName: FeatureId;
Expand All @@ -29,6 +30,7 @@ const FeatureFlagDetails: React.FC<Props> = props => {
const { flagName, focused, setFocusedName } = props;
const { getFeature } = useFeatureFlags();
const flagValue = getFeature(flagName as FeatureId);
const { t } = useTranslation();

const {
overriddenByEnv,
Expand Down Expand Up @@ -57,21 +59,21 @@ const FeatureFlagDetails: React.FC<Props> = props => {
<Text mr={1}>{flagName}</Text>
{overriddenByEnv ? (
<Tag active mx={1} type="opacity" size="small">
overridden by env
{t("settings.developer.overridden.byEnv")}
</Tag>
) : overridesRemote ? (
<Tag active mx={1} type="opacity" size="small">
overridden locally
{t("settings.developer.overridden.overriddenLocally")}
</Tag>
) : null}
{enabledOverriddenForCurrentLanguage ? (
<Tag active mx={1} type="outlinedOpacity" size="small">
disabled for current language
{t("settings.developer.overridden.disableForLanguage")}
</Tag>
) : null}
{enabledOverriddenForCurrentDesktopVersion ? (
<Tag active mx={1} type="outlinedOpacity" size="small">
disabled for current version
{t("settings.developer.overridden.disableForVersion")}
</Tag>
) : null}
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const GroupedFeatures = ({ groupName, focused, setFocusedGroupName }: Props) =>
<Text mr={1}>{groupName}</Text>
{someOverridden ? (
<Tag active mx={1} type="opacity" size="small">
overridden locally
{t("settings.developer.overridden.overriddenLocally")}
</Tag>
) : null}
<Flex flexDirection="row" alignItems={"center"}>
Expand Down
6 changes: 6 additions & 0 deletions apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3874,6 +3874,12 @@
"flagHint": "If a feature flag is defined in the targeted Firebase environment \nbut it is missing from the following list, you can type its **exact** name in \nthe search input and it will appear in the list. Type the \nflag name in camelCase without the 'feature' prefix.",
"showButtonDesc": "Always display the Feature Flags button in the Sidebar",
"buttonTitle": "Flags overridden locally",
"overridden": {
"byEnv": "overridden by env",
"overriddenLocally": "overridden locally",
"disableForLanguage": "disabled for current language",
"disableForVersion": "disabled for current version"
},
"firebaseProject": "Firebase project targeted by this build:",
"addLocalApp": "Add a local app",
"addLocalAppDesc": "Browse local files and add a local app using a local manifest",
Expand Down

0 comments on commit af02611

Please sign in to comment.