I enabled spanish language support by installing 'luci-i18n-es' package and it is reflected in LuCI under "System --> Sytem --> Language and Style" list.
When I select 'spanish' language and apply the configuration, I could see the Status, System, Services and Networ menus are translated.
How can I bring in the language translation to the newly added menu in LuCI based as per the selected language settings?
If "newly added menu" you mean you wrote code to add a new menu, you also need to write the translations for it and anything else you created in the translation file. Translation is not automatic.
You'll then find a file called applications/luci-app-yourapp/po/es/yourapp.po which you can translate using utilities like poedit.
To test the translation on-target, there's two solutions:
Variant 1 (using OpenWrt buildroot or SDK and your customized luci.git as feed)
Rebuild the package: make package/luci-app-yourapp/{clean,compile}in the OpenWrt buildroot - this should also rebuild the hidden luci-i18n-yourapp-es package
Transfer the .ipk archive from bin/packages/*/luci/luci-i18n-yourapp-es*.ipk to your target device and install it with opkg or upload it via the LuCI software page
Variant 2 (just build the binary lmo file without OpenWrt buildroot or SDK)
Compile the po2lmo utility: make -C ./modules/luci-base/src po2lmo (mind the space, execute in the LuCI sourcetree topdir)
Run ./modules/luci-base/src/po2lmo ./applications/luci-app-yourapp/po/es/yourapp.po /tmp/yourapp.es.lmo
Transfer /tmp/yourapp.es.lmo to /usr/lib/lua/luci/i18n/yourapp.es.lmo on the target device
@jow
Thank you very much for the details. I am able to make the language translation to work as expected for the newly added LuCI modules/applications.