Added random versioning prefix to the translations so the users don't have to clear the cache

pull/2142/head
Jamie 7 years ago
parent da096792af
commit c14fd64f5f

@ -58,10 +58,11 @@ const routes: Routes = [
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
const base = platformLocation.getBaseHrefFromDOM();
const version = Math.floor(Math.random() * 999999999);
if (base.length > 1) {
return new TranslateHttpLoader(http, `${base}/translations/`, ".json");
return new TranslateHttpLoader(http, `${base}/translations/`, `.json?v=${version}`);
}
return new TranslateHttpLoader(http, "/translations/", ".json");
return new TranslateHttpLoader(http, "/translations/", `.json?v=${version}`);
}
@NgModule({

@ -1,21 +0,0 @@
SERVICE="Ombi"
# change directory to location of project.json
pushd ./
# run dotnet publish, specify release build
dotnet publish -c Release
# equivalent to cd .. (go back to previous directory)
#popd
# Create a docker image tagged with the name of the project:latest
docker build -t "$SERVICE":latest .
# Check to see if this container exists.
CONTAINER=`docker ps --all | grep "$SERVICE"`
# if it doesn't, then just run this.
if [ -z "$CONTAINER" ]; then
docker run -i -p 8000:5000 --name $SERVICE -t $SERVICE:latest
# if it does exist; nuke it and then run the new one
else
docker rm $SERVICE
docker run -i -p 8000:5000 --name $SERVICE -t $SERVICE:latest
fi
read -p "Press enter to continue"
Loading…
Cancel
Save