Can you give an example of your usage of :after? Not sure I follow what
you're saying here.

Also, something you may have to consider is if your app is localized and
you have to consider other languages. If the text is hard-coded then it's
probably even messier to manage this. I don't have an exact solution, but
if it's localized, maybe you could store a key-value pair of translations
as a data-* property - but that even sounds gross. Now I'm just thinking
out loud...

What I've done in the past is let the server-side determine the text of the
link/button. When it's clicked, I store the text as a data attribute on
that link/button. I then change the text to "Saving..." or something, and
once completed, restore the original text. I'll admit I've not had to deal
with localization heavily, so this hasn't really been an issue.

~Philip


On Sun, Feb 19, 2012 at 1:32 PM, Sanford Whiteman <[email protected]>wrote:

> I use :after whenever possible, using attr() from data- attrs for anything
> beyond "known" buttons like on/off.  When :after isn't possible, I switch
> data- attrs using JS.
> I know what you mean about it not feeling right.  But then again, the way
> you build buttons and maintain string resources in Visual C++, etc. always
> felt even worse!
>
> -- Sandy
>

-- 
http://lonestarlightandsound.com/

Reply via email to