{"id":13558943,"url":"https://github.com/opendata-stuttgart/sensor.community","last_synced_at":"2025-04-03T14:30:49.121Z","repository":{"id":42928273,"uuid":"231798478","full_name":"opendata-stuttgart/sensor.community","owner":"opendata-stuttgart","description":":sparkles: new shiny website built with svelte :heart: for dust and noise measuring project :point_right:  https://sensor.community","archived":false,"fork":false,"pushed_at":"2024-08-15T22:30:27.000Z","size":37458,"stargazers_count":49,"open_issues_count":17,"forks_count":42,"subscribers_count":12,"default_branch":"develop","last_synced_at":"2024-10-29T22:32:23.180Z","etag":null,"topics":["javascript","sapper","sensor-community","svelte"],"latest_commit_sha":null,"homepage":"https://sensor.community","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opendata-stuttgart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-01-04T17:02:14.000Z","updated_at":"2024-08-15T22:30:30.000Z","dependencies_parsed_at":"2024-01-16T05:07:32.033Z","dependency_job_id":null,"html_url":"https://github.com/opendata-stuttgart/sensor.community","commit_stats":{"total_commits":392,"total_committers":28,"mean_commits":14.0,"dds":0.4413265306122449,"last_synced_commit":"4e4af9d6fe79a2b96d536b0846c7a802da0adcac"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendata-stuttgart%2Fsensor.community","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendata-stuttgart%2Fsensor.community/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendata-stuttgart%2Fsensor.community/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendata-stuttgart%2Fsensor.community/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opendata-stuttgart","download_url":"https://codeload.github.com/opendata-stuttgart/sensor.community/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222283330,"owners_count":16960534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","sapper","sensor-community","svelte"],"created_at":"2024-08-01T12:05:14.891Z","updated_at":"2024-11-04T10:30:41.656Z","avatar_url":"https://github.com/opendata-stuttgart.png","language":"Svelte","funding_links":[],"categories":["Svelte","javascript","Natural Resources"],"sub_categories":["Air Quality"],"readme":"# sensor.community website\n\n:sparkles: new shiny website for dust and noise measuring project :point_right: sensor.community\n\n## How to install\n### Prerequisites\n\n* [Node.js (v11+)](https://nodejs.org/)\n* [Yarn (optional)](yarnpkg.com)\n\n## Get started\n\ninside the folder install the dependencies...\n\n```bash\nnpm install\n```\n\nor with yarn\n\n```bash\nyarn install\n```\n\n...then start [Rollup](https://rollupjs.org):\n\n```bash\nnpm run dev or sapper dev\n```\n\nalternative use yarn\n```bash\nyarn install\nyarn dev or sapper dev\n```\n\nNavigate to [localhost:3000](http://localhost:3000). \nYou should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.\n\nBy default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.\n\n### Getting started with Svelte \u0026 Sapper\nWebsite is based on [Svelte 3](https://svelte.dev) and [Sapper](https://sapper.svelte.dev).\nPlease consider reading the documentation.\n\n## Translation\n\n**1. Create locale file**\n\nduplicate `locales/en.json` file and rename it to language by [iso-3166-alpha2](https://en.wikipedia.org/wiki/ISO_3166-1) coding, for example *fr* for French.\nTranslate the **values** in the locale file:\n```javascript\n{\n    \"nav\": {\n      \"home\": \"Accueil\", \u003c- \"Accueil\" is the value\n        ...\n    },\n```\n\nNow duplicate `content/airrohr/en` folder and rename it again to language by [iso-3166-alpha2](https://en.wikipedia.org/wiki/ISO_3166-1) coding.\nAlso duplicate `content/dnms/en`for the DNMS guide. Translate both \n\n![assembly guide](assembly-guide-markdown.png)\n\nIt's written in markdown. To get used to the markdown syntax, visit [www.markdownguide.org](https://www.markdownguide.org/getting-started/).\n\n**FYI** You can leave the filename. The title will be taken from the beginning of each file, see picture above.\n\n**2. Add new language to the init18n.js**\n\nGo to `src/utils/initI18n.js`. Add the new language, in this case it's French.\nFirst add the path to the locale file, then add it to the resources.\n\n```javascript\nimport fr from '../../locales/fr';  // path to the locale file\n\nfunction initI18n(lng = 'en') {\n  i18next.init({\n    lng,\n    resources: {\n      en,\n      de\n      de,\n      fr\n    },\n```\n\n Go to `src/routes/[lang]/_layout.svelte`  and extend the array with the new language.\n ```html\n\u003cscript context=\"module\"\u003e\n    const LANGUAGES = [\"en\", \"de\", \"fr\"];  // \u003c- add new lanuage in the array\n    const DEFAULT_LANGUAGE = \"en\";\n    export async function preload(page) {...\n```\n\n**3. Add language to the navbar**\n\nTo add the language in the navbar go to `src/components/LanguageSwitcher.svelte`. Scroll down to around Line 24 and add this line with the corresponding language.\n\n```javascript\nconst langauges = [\n        \"gb\", \"de\", \"fr\", \"it\", \"sk\", \"ru\" // \u003c- add new lanuage in the array\n    ]\n```\n\n**4. Add endpoints**\n\n Duplicate inside `src/routes/endpoints/airrohr` or `src/routes/endpoints/dnms`  then `en` folder to the [iso-3166-alpha2](https://en.wikipedia.org/wiki/ISO_3166-1), e.g. `fr`. Inside the `index.json.js` file change line 8.\n \n ````javascript\nimport send from '@polka/send';\nimport generate_docs from '../../../../utils/generate_docs.js';\n\nlet json;\n\nexport function get(req, res) {\n    if (!json || process.env.NODE_ENV !== 'production') {\n        json = JSON.stringify(generate_docs('airrohr/fr'));  // \u003c- change the lanuage iso-code \n    }\n\n    send(res, 200, json, {\n        'Content-Type': 'application/json'\n    });\n\t\n}\n\n````\n\n\n## Bugs and feedback\nThe website is in early development, and may have the rough edge here and there. \n\n## Deployment\n```bash\nyarn export or sapper export\n```\n\ncopy content of `__sapper__/export` to a ftp server\n\nHappy coding :tada: :raised_hands:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendata-stuttgart%2Fsensor.community","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopendata-stuttgart%2Fsensor.community","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendata-stuttgart%2Fsensor.community/lists"}