GetX Google Sheets Translation Code Generator

Jeff McMorris
2 min readApr 14, 2021

When handling localization for my app I was using the excellent https://pub.dev/packages/flutter_sheet_localization package. I have also been using the GetX package. GetX now has their own translation code options so I wanted the benefits of storing my translations in google sheets but also wanted the ability to have the code I would need for GetX generated automatically since you must write a lot of tedious code to translate your app.

I created a code generator that will do this.

So let me explain how it works. You need to create a translation for your app in google sheets.

You can copy my sheet as a starting point for your own app. The cool thing about using a google sheet is you can have google translate a field with a simple google formula: =GOOGLETRANSLATE(B4,en,fr) This says translate the phrase in field B4 from english to french. Next you can edit the main.dart file in the project I listed earlier and edit these two lines.

//the document id for your google sheet  
String documentId =…

--

--