如何在Super CSV中显示本地化的错误消息 [英] How to display localized error messages in Super CSV

查看:108
本文介绍了如何在Super CSV中显示本地化的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的母语是西班牙语,我想知道如何定位Super CSV单元处理器显示的错误消息,而无需再次编译源代码.

My mother tongue is Spanish and I would like to know how to localize the error messages displayed by Super CSV's cell processors without compiling the source again.

推荐答案

我知道在超级CSV中本地化错误消息的想法已经浮出水面了好几年了-只是从来没有足够的需求来保证它(还有很多其他需求)图书馆都支持它).我在整个代码中对所有异常消息都使用了String.format,因此,如果我们添加它,将相对容易.

I know the idea for localizing error messages in Super CSV has been floating around for years now - it's just never had enough demand to warrant it (and not many other libraries support it either). I've used String.format for all exception messages throughout the code, so if we ever do add it it'll be relatively easy.

您最好的选择(您可能会喜欢,也可能不喜欢),是将单元处理器复制到您自己的项目中,并修改源代码以设置西班牙语格式的异常(只使用您的单元处理器而不是来自Super的单元处理器) CSV).这比尝试进行某种映射要干净得多.

Your best bet (and you may or may not like this), is to copy the cell processors into your own project and modify the source to format the exceptions in Spanish (and just use your cell processors instead of the ones from Super CSV). That's probably a lot cleaner than trying to do some kind of mapping.

这篇关于如何在Super CSV中显示本地化的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆