Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

122
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda