<template>
  <section class="container px-4 py-24 mx-auto">
    <div class="simplecontent">
      <div class="mb-24 text-left md:text-center">
        <h1
          class="mb-4 text-4xl font-bold leading-tight text-gray-900 dark:text-gray-50 md:text-5xl"
        >{{ $t('privacy_policy') }}</h1>
      </div>
      <div class="mx-auto prose" v-html="content"></div>
    </div>
  </section>
</template>
<style src="../simple.css">
</style>
<script>
import marked from "marked";
export default {
  data() {
    return {
      content: ""
    }
  },
  async beforeMount() {
    const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
    let md = "";
    try {
      md = await fetch(`/privacy_${browserlocale}.md`);
    } catch (error) {
      try {
        md = await fetch(`/privacy_en.md`);
      } catch (error) {
        md = "Error loading Privacy Policy";
      }
    }
    this.content = marked(await md.text());
  },
}
</script>