Sorry if this doesn't make sense (I'm 2 days into my Next.js self learning) but can't you just use the route:
pages/[language]/[app-slug]
and then in the page script:
export default function Page({ params }){
const {app-slug} = use(params)
Script.load({app-slug}+".js");