Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
Changing font family for Arabic translation

I am trying to change the Font-Family for the Arabic text in the app. I am using i18Next for the translation. The translation is working perfectly but I am trying to add a custom font for just the Arabic language.

const {t} = useTranslation({fontNames: [`${GLOBAL_APP_ARABIC_FONT}`]});

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I have no idea how that works in react but under the assumption that the lang attribute changes properly you could do this in CSS:

html {
    font-family: your-latin-font
}
html[lang*=ar] {
    font-family: your-arabic-font
}
about 4 years ago · Juan Pablo Isaza Relatório

0

I don't think you can set a global font-family we have a similar thing in our app we just created a custom component for text so that we don't have to set font-family in every Text component.

I am sharing coding for our component you can tweak it to use in JS and use it instead of Text if you like this solution.

import { observer } from 'mobx-react';
import React from 'react';
import { Text, TextProps } from 'react-native';
import { useStores } from '../stores/rootStore';

type OwnProps = {
  RTLAlign?: boolean;
};

export const AppText = observer((props: TextProps & OwnProps) => {
  const { settingsStore } = useStores();
  const { style, ...rest } = props;
  return (
    <Text
      allowFontScaling={false}
      // eslint-disable-next-line react/jsx-props-no-spreading
      {...rest}
      style={[
        {
          fontFamily: settingsStore.font // Set condition for font family based on language
        },
        style
      ]}
    />
  );
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda