Hi everyone! In this blog post, I want to share with you how I developed a string translation tool using Code Igniter and Ag Grid in just two weeks. This tool allows users to upload a CSV file with strings in different languages and edit them using a web interface. It also supports exporting the edited strings back to CSV format.
Why Code Igniter and Ag Grid?
Code Igniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. It has exceptional performance, strong security, clear documentation, and almost zero configuration. It also encourages MVC (Model-View-Controller) architecture, but does not force it on you.
I chose these two technologies because they are both easy to use and integrate well with each other. They also have good support and documentation online.
How I developed the tool
The first step was to set up the project structure using Code Igniter’s built-in tools. I created a controller class for handling requests from the user interface, a model class for interacting with the database where the strings are stored, and a view class for rendering the HTML page with Ag Grid.
The next step was to implement the file upload feature using Code Igniter’s file helper library. I used this library to validate the uploaded CSV file format and parse its contents into an array of strings. I then inserted this array into the database using Code Igniter’s query builder class.
The third step was to display the strings in Ag Grid using its API. I defined the column definitions for each language column and set their properties such as sortable, filterable, editable etc. I also enabled row selection and range selection features for convenience. Then I fetched the data from the database using Code Igniter’s model class and passed it to Ag Grid’s
The fourth step was to implement the editing feature using Ag Grid’s cell editing events. Whenever a user edits a cell value in Ag Grid, it triggers an event that contains information about the edited row and column. I used this information to update the corresponding record in the database using Code Igniter’s query builder class.
The final step was to implement the export feature using Ag Grid’s export data as CSV method. This method allows you to export all or selected rows from Ag Grid as a CSV file with custom parameters such as delimiter, filename etc. I added a button on the web page that calls this method when clicked.
In this blog post, I showed you how I developed a string translation tool using Code Igniter and Ag Grid in just two weeks. This tool allows users to upload a CSV file with strings in different languages and edit them using a web interface. It also supports exporting the edited strings back to CSV format.
I hope you found this post useful and interesting. If you want to learn more about Code Igniter or Ag Grid, you can check out their official websites or their documentation pages . You can also find some tutorials online .
Thanks for reading!