I've used the script MaMe82 posted a while ago and it's really powerful.
I used it with this duckscript compiler which let you choose your keyboard layout (the language combobox)
https://ducktoolkit.com/encoder/But it's only good if you just need to use the keyboard without any use of the attiny's gpio for example.
If you need, I've modified a few files for azerty layout, you can find them here with some explanation of what I did
https://github.com/digistump/DigistumpArduino/issues/46All the characters are working, including the ones that need altgr key.
Hopefully the same process would work for other layouts