How to replace existing poor translation with different one in Helm installation?

Hi,

I am trying to replace one of the existing poor translation with different custom one, particularly the .po file. How is this supposed to be done properly in Helm installation? Taking into consideration I am building custom Dockerimage to preinstall some apps in the deployment.

This sounds simple, but nothing I tried worked.

For example, I added this code to the very bottom of the frappe_docker/images/custom/Containerfile at main · frappe/frappe_docker · GitHub

# --- CUSTOM ARABIC TRANSLATIONS START ---
USER root
WORKDIR /home/frappe/frappe-bench

# 1. Clone & Copy Translations
RUN git clone --depth 1 --branch v0.1.0 https://github.com/ibrahim317/erpnext-arabic-full-translation.git /tmp/arabic_fix && \
    mkdir -p apps/erpnext/erpnext/locale apps/frappe/frappe/locale && \
    cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/erpnext/erpnext/locale/ar.po apps/erpnext/erpnext/locale/ar.po && \
    cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/frappe/frappe/locale/ar.po apps/frappe/frappe/locale/ar.po && \
    if [ -d "apps/hrms" ]; then \
        mkdir -p apps/hrms/hrms/locale; \
        cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/hrms/hrms/locale/ar.po apps/hrms/hrms/locale/ar.po; \
    fi && \
    rm -rf /tmp/arabic_fix && \
    chown -R frappe:frappe apps/erpnext/erpnext/locale apps/frappe/frappe/locale

USER frappe

# 2. Rebuild Assets (Includes Translations)
#RUN bench build --force
# --- CUSTOM ARABIC TRANSLATIONS END ---

This is not working, then I tried running bench build --force in the end, but this caused the whole page formatting (probably the css) to get broken. Actually executing the build even in the pod/container itself breaks the css/formatting. Though I see the correct translation after calling build, but as mentioned, this is breaking the whole css.

How should this be done properly for Helm installation with custom Docker image?

Finally..

To get Helm installation working with the enhanced translation, the following steps has to be following to build a custom Docker image:

git clone https://github.com/frappe/frappe_docker

cd frappe_docker

vim images/custom/Containerfile

In the Custom Dockerfile, after the step bench init and before the step of switching the image stage FROM base AS backend, add the following block to patch the new translations:

# --- CUSTOM ARABIC TRANSLATIONS START ---
USER root
WORKDIR /home/frappe/frappe-bench

# 1. Override the existing app translations with enhanced translations.
RUN git clone --depth 1 --branch v0.1.0 https://github.com/ibrahim317/erpnext-arabic-full-translation.git /tmp/arabic_fix && \
    mkdir -p apps/erpnext/erpnext/locale apps/frappe/frappe/locale && \
    cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/erpnext/erpnext/locale/ar.po apps/erpnext/erpnext/locale/ar.po && \
    cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/frappe/frappe/locale/ar.po apps/frappe/frappe/locale/ar.po && \
    if [ -d "apps/hrms" ]; then \
        mkdir -p apps/hrms/hrms/locale; \
        cp -f /tmp/arabic_fix/arabic_translations/locale/other-apps/v16/hrms/hrms/locale/ar.po apps/hrms/hrms/locale/ar.po; \
    fi && \
    rm -rf /tmp/arabic_fix && \
    chown -R frappe:frappe apps/erpnext/erpnext/locale apps/frappe/frappe/locale

USER frappe

# 2. Compile the translations from apps folders (.po format) to sites/assets (.mo format)
RUN bench compile-po-to-mo --app frappe && \
      bench compile-po-to-mo --app erpnext && \
      bench compile-po-to-mo --app hrms
# --- CUSTOM ARABIC TRANSLATIONS END ---

Then continue building the image.