I've created a tag that will be used for products in search results. In English everything is ok. but when doing localization for languages like Bahasa the words can become very long. How do I handle these situations, especially given that this tag sits in a limited space next to the product. So far what I've come up with is going to the next line. but it can end up looking odd. Any other solutions to overcome this?
I think the option you have taken is already the correct one.
Your design should always accommodate for larger text (in both font size and length) because you should also be considering accessibility of you design. For example, if this is a web application, then the user might have the browser set to display large fonts or have the zoom set to a higher value than the default 100%.
With regards to it "looking odd", it's hard to comment without seeing the rest of your design and where these tags would fit into that. However, I would recommend that you expect tags to sometimes span multiple lines and try to find a design that accommodates that situation just as well as it does for single-line tags.