Posted 6 August 2021, 12:39 am EST
- Updated 3 October 2022, 12:34 am EST
EDIT: Solved!
Hi Avinash,
I’m also in the process of setting up translations but I’m hitting issues. Our use case is a bit more involved than the demo above as we use Webpack 4 and @grapecity/spread-sheets-designer-react.
With the react wrapper I can confirm that the line in the react wrapper that initializes the Designer has DesignerRes with translated strings but the UI does not reflect that everywhere.
For example, I get translations in the Hyperlink modal dialog but not on the ribbon and not in the barcode dialog.
The import order is as follows:
import '@grapecity/spread-sheets-designer-resources-en';
import GC from '@grapecity/spread-sheets';
import * as Excel from '@grapecity/spread-excelio';
// forEach loop on DesignerRes.res // recursive loop on DesignerRes.res updating properties // Proxy injection for linking our translation system // DesignerRes.res reassignment
// from the above only the last one does not work, the rest gives the same symptoms
import GCDesigner from '@grapecity/spread-sheets-designer';
// later, in another file we import
import type GC from '@grapecity/spread-sheets-designer';
import { Designer } from '@grapecity/spread-sheets-designer-react';
// <Designer /> in render function
Is this a known issue? Is there anything else I could check to diagnose why it’s not using translated strings?
Solution:
The import order was wrong because webpack. I moved the overriding as high in the import tree as I could and it worked. Managed to debug it by beautifying the designer source and checking what “…/localization/resentry” had set on initialization. Thanks for not obfuscating the source because otherwise I would run in circles far longer.