I need regenerate urls for all products (about 3000). Befere my regeneration urls are like https://my-shop.example.com/product/view/id/xxx/s/name-of-product. I need my products urls will be like https://my-shop.example.com/name-of-product.html.
I'm trying use magento method
\Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator->generate($product). It works but my diacritics (like ąęłóźż) are trimmed (e.g. product link become https://my-shop.example.com/jaki-tam-adny-produkt.html instead of https://my-shop.example.com/jakis-tam-ladny-produkt.html)
I tried use also
$product->save(). Backend shows my changed url keys but I didn't seen changes on frontend. I tried use steps from https://github.com/magento/magento2/issues/5929#issuecomment-238170690 but it only restore ugly urls like was on start ( e.g. https://my-shop.example.com/product/view/id/xxx/s/name-of-product)
I'm using Magento 2.2.4